[exception handling] Fix case the current working directory (CWD) gets deleted during testing.
Fixes #1235.
This commit is contained in:
committed by
Martin K. Scherer
parent
70fdab4cfa
commit
09d163aa3a
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user