summaryrefslogtreecommitdiff
path: root/testing/code
diff options
context:
space:
mode:
authormarscher <m.scherer@fu-berlin.de>2016-06-07 15:43:05 +0200
committerMartin K. Scherer <m.scherer@fu-berlin.de>2016-06-08 15:18:23 +0200
commit09d163aa3a1f01701fe2e3f073a89d49b9d0cce2 (patch)
tree442561772d96a49276807febcb0257d326751f50 /testing/code
parent70fdab4cfa12acdcdd449ec5f979e32efc1af1ff (diff)
downloadpytest-09d163aa3a1f01701fe2e3f073a89d49b9d0cce2.tar.gz
[exception handling] Fix case the current working directory (CWD) gets deleted during testing.
Fixes #1235.
Diffstat (limited to 'testing/code')
-rw-r--r--testing/code/test_excinfo.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py
index 47ad50b06..ba047f2a9 100644
--- a/testing/code/test_excinfo.py
+++ b/testing/code/test_excinfo.py
@@ -925,3 +925,14 @@ def test_repr_traceback_with_unicode(style, encoding):
repr_traceback = formatter.repr_traceback(e_info)
assert repr_traceback is not None
+
+def test_cwd_deleted(testdir):
+ testdir.makepyfile("""
+ def test(tmpdir):
+ tmpdir.chdir()
+ tmpdir.remove()
+ assert False
+ """)
+ result = testdir.runpytest()
+ result.stdout.fnmatch_lines(['* 1 failed in *'])
+ assert 'INTERNALERROR' not in result.stdout.str() + result.stderr.str()