New issue 438: entering pdb from pytest's internal test suite breaks pytest 
later
https://bitbucket.org/hpk42/pytest/issue/438/entering-pdb-from-pytests-internal-test

Jurko Gospodnetić:

Consider the following test case prepared to be run as a part of pytest's 
internal test suite:

```
class TestJurko:
    def test_entering_pdb_breaks_pytest(self, testdir):
        testdir.makepyfile("""\
def test_me():
    out = "one\ntwo\nthree"
""")
        import pdb
        #pdb.set_trace()
        testdir.runpytest()
```

If you run it *as is*, the test will pass. But if you:

1. uncomment the ```pdb.set_trace()```
2. run the test
3. use the ```c``` command in it ```pdb``` debugger prompt to continue with the 
program

pytest will break with something similar to:

```
=================================== ERRORS ====================================
_____________ ERROR collecting test_entering_pdb_breaks_pytest.py _____________
C:\Program Files\Python\Python333\lib\site-packages\_pytest\python.py:451: in 
_importtestmodule
>           mod = self.fspath.pyimport(ensuresyspath=True)
C:\Program Files\Python\Python333\lib\site-packages\py\_path\local.py:620: in 
pyimport
>           __import__(modname)
E             File 
"c:\users\jurko\appdata\local\temp\pytest-4447\testdir\test_entering_pdb_breaks_pytest0\test_entering_pdb_breaks_pytest.py",
 line 2
E               out = "one
E                        ^
E           SyntaxError: EOL while scanning string literal
=========================== 1 error in 0.06 seconds ===========================
```

Hope this helps.

Best regards,
  Jurko Gospodnetić


_______________________________________________
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit

Reply via email to