From 35e6dd01173de0b58e175d79e58d6295c359a0bd Mon Sep 17 00:00:00 2001 From: Florian Dahlitz Date: Sat, 23 May 2020 18:19:33 +0200 Subject: [PATCH] Add test for exposure of underlying exception --- testing/test_debugging.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testing/test_debugging.py b/testing/test_debugging.py index 719d6477b..00af4a088 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -342,6 +342,15 @@ class TestPDB: child.sendeof() self.flush(child) + def test_pdb_prevent_ConftestImportFailure_hiding_exception(self, testdir): + testdir.makepyfile("def test_func(): pass") + sub_dir = testdir.tmpdir.join("ns").ensure_dir() + sub_dir.join("conftest").new(ext=".py").write("import unknown") + sub_dir.join("test_file").new(ext=".py").write("def test_func(): pass") + + result = testdir.runpytest_subprocess("--pdb", ".") + result.stdout.fnmatch_lines(["-> import unknown"]) + def test_pdb_interaction_capturing_simple(self, testdir): p1 = testdir.makepyfile( """