Skip to content

Commit 7e5882a

Browse files
author
Philipp Loose
committed
Add test for _issue_warning_captured in _pytest.resultlog.pytest_configure
1 parent 4821848 commit 7e5882a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

testing/acceptance_test.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,3 +1300,21 @@ def test_issue4445_import_plugin(testdir):
13001300
"*skipped plugin 'some_plugin': thing*",
13011301
]
13021302
)
1303+
1304+
1305+
def test_issue4445_resultlog(testdir):
1306+
"""#4445: Make sure the warning points to a reasonable location
1307+
See origin of _issue_warning_captured at: _pytest.resultlog.py:35
1308+
"""
1309+
testdir.makepyfile(
1310+
"""
1311+
def test_dummy():
1312+
pass
1313+
"""
1314+
)
1315+
result = testdir.runpytest(
1316+
"--result-log={dir}".format(dir=testdir.tmpdir.join("result.log"))
1317+
)
1318+
# with stacklevel=2 the warning originates from resultlog.pytest_configure
1319+
# and is thrown when --result-log is used
1320+
result.stdout.fnmatch_lines(["*resultlog.py:35*", "*--result-log is deprecated*"])

0 commit comments

Comments
 (0)