Skip to content

Commit d1722d5

Browse files
committed
fix test for codecov
1 parent 61133ba commit d1722d5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

testing/test_assertrewrite.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,9 @@ def myany(x) -> bool:
685685
assert msg is not None
686686
assert "<MY42 object> < 0" in msg
687687

688-
def test_assert_handling_raise_in__iter__(self) -> None:
689-
def f() -> None:
688+
def test_assert_handling_raise_in__iter__(self, pytester: Pytester) -> None:
689+
pytester.makepyfile(
690+
"""\
690691
class A:
691692
def __iter__(self):
692693
raise ValueError()
@@ -698,10 +699,10 @@ def __repr__(self):
698699
return "<A object>"
699700
700701
assert A() == A()
701-
702-
msg = getmsg(f)
703-
assert msg is not None
704-
assert "<A object> == <A object>" in msg
702+
"""
703+
)
704+
result = pytester.runpytest()
705+
result.stdout.fnmatch_lines(["*E*assert <A object> == <A object>"])
705706

706707
def test_formatchar(self) -> None:
707708
def f() -> None:

0 commit comments

Comments
 (0)