Skip to content

Commit e37c58c

Browse files
author
Victor
committed
Updated test to account for lineno argument.
1 parent 8c07723 commit e37c58c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

testing/test_assertrewrite.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,8 +1009,8 @@ def test_simple_failure():
10091009
class TestAssertionPass():
10101010
def test_hook_call(self, testdir):
10111011
testdir.makeconftest("""
1012-
def pytest_assertion_pass(config, orig, expl):
1013-
raise Exception("Assertion Passed: {} {}".format(orig, expl))
1012+
def pytest_assertion_pass(item, lineno, orig, expl):
1013+
raise Exception("Assertion Passed: {} {} at line {}".format(orig, expl, lineno))
10141014
""")
10151015
testdir.makepyfile("""
10161016
def test_simple():
@@ -1022,4 +1022,4 @@ def test_simple():
10221022
assert a+b == c+d
10231023
""")
10241024
result = testdir.runpytest()
1025-
result.stdout.fnmatch_lines('*Assertion Passed: (a + b) == (c + d) (1 + 2) == (3 + 0)*')
1025+
result.stdout.fnmatch_lines('*Assertion Passed: (a + b) == (c + d) (1 + 2) == (3 + 0) at line 7*')

0 commit comments

Comments
 (0)