File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,10 @@ def isiterable(obj: Any) -> bool:
136136 return False
137137 except Exception as e :
138138 raise ValueError (
139- f"Unexpected exception { e !r} while testing object { obj !r} . Probably an issue with __iter__"
139+ [
140+ f"pytest_assertion plugin: unexpected exception { e !r} while testing object { obj !r} " ,
141+ ", probably from __iter__" ,
142+ ]
140143 )
141144
142145
@@ -203,9 +206,9 @@ def assertrepr_compare(
203206 if (
204207 isinstance (e , ValueError )
205208 and (len (e .args ) == 1 )
206- and ("Unexpected exception " in str (e .args [0 ]))
209+ and ("__iter__ " in str (e .args [0 ]))
207210 ):
208- explanation = [ e .args [0 ] ]
211+ explanation = e .args [0 ]
209212 else :
210213 explanation = [
211214 "(pytest_assertion plugin: representation of details failed: {}." .format (
Original file line number Diff line number Diff line change @@ -698,7 +698,7 @@ def __eq__(self, o: object) -> bool:
698698
699699 msg = getmsg (f )
700700 assert msg is not None
701- assert "Unexpected exception" in msg
701+ assert "__iter__" in msg and "__repr__" not in msg
702702
703703 def test_formatchar (self ) -> None :
704704 def f () -> None :
You can’t perform that action at this time.
0 commit comments