From 11478c59aca25e2eace7deb85a96ee757793a063 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 7 Nov 2018 23:37:43 +0100 Subject: [PATCH] TODO: add failing test_capture_with_testdir_parseconfig [skip appveyor] Fails with: > OSError: reading from stdin while output is captured Also tests https://github.com/pytest-dev/pytest/pull/4330 (i.e. fails without #4330 earlier already). --- testing/test_pdb.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/testing/test_pdb.py b/testing/test_pdb.py index 49fbbad7224..c33c323d9d3 100644 --- a/testing/test_pdb.py +++ b/testing/test_pdb.py @@ -879,3 +879,22 @@ def test_2(): rest = child.read().decode("utf8") assert "no tests ran" in rest TestPDB.flush(child) + + +def test_capture_with_testdir_parseconfig(testdir): + """Test capturing with inner node of config setup. Also tests #4330.""" + p = testdir.makepyfile( + """ + def test_inner(testdir): + hello = testdir.makefile(".py", hello="world") + __import__('pdb').set_trace() + node = testdir.parseconfig(hello) + """ + ) + child = testdir.spawn_pytest("-s -p pytester %s" % p) + child.expect(r"\(Pdb") + child.sendline("n") + child.sendline("c") + rest = child.read().decode("utf8") + TestPDB.flush(child) + assert child.exitstatus == 0, rest