Skip to content

Commit 44b8439

Browse files
committed
Add a test for pytest-dev#1235
1 parent 63b6932 commit 44b8439

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

testing/acceptance_test.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,18 @@ def test_chdir(self, testdir):
212212
result = testdir.runpython(p)
213213
assert not result.ret
214214

215+
def test_removing_cwd(self, testdir):
216+
testdir.makepyfile("""
217+
def test_deleting_cwd(tmpdir, monkeypatch):
218+
work = tmpdir.mkdir("work")
219+
monkeypatch.chdir(work)
220+
work.remove()
221+
# Actual testing here
222+
assert False
223+
""")
224+
result = testdir.runpytest()
225+
assert result.ret == EXIT_TESTSFAILED
226+
215227
def test_issue109_sibling_conftests_not_loaded(self, testdir):
216228
sub1 = testdir.tmpdir.mkdir("sub1")
217229
sub2 = testdir.tmpdir.mkdir("sub2")
@@ -678,4 +690,3 @@ def test_setup_function(self, testdir):
678690
* setup *test_1*
679691
* call *test_1*
680692
""")
681-

0 commit comments

Comments
 (0)