Skip to content

Commit 35e6dd0

Browse files
Add test for exposure of underlying exception
1 parent d0eb86c commit 35e6dd0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

testing/test_debugging.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,15 @@ def pytest_runtest_protocol():
342342
child.sendeof()
343343
self.flush(child)
344344

345+
def test_pdb_prevent_ConftestImportFailure_hiding_exception(self, testdir):
346+
testdir.makepyfile("def test_func(): pass")
347+
sub_dir = testdir.tmpdir.join("ns").ensure_dir()
348+
sub_dir.join("conftest").new(ext=".py").write("import unknown")
349+
sub_dir.join("test_file").new(ext=".py").write("def test_func(): pass")
350+
351+
result = testdir.runpytest_subprocess("--pdb", ".")
352+
result.stdout.fnmatch_lines(["-> import unknown"])
353+
345354
def test_pdb_interaction_capturing_simple(self, testdir):
346355
p1 = testdir.makepyfile(
347356
"""

0 commit comments

Comments
 (0)