From 44b8439b4fedc873fb9e5cd5026d8b8abc51fe52 Mon Sep 17 00:00:00 2001 From: Dimitri Merejkowsky Date: Tue, 1 Mar 2016 15:17:08 +0100 Subject: [PATCH] Add a test for #1235 --- testing/acceptance_test.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 74db4425d19..28318228a48 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -212,6 +212,18 @@ def test_chdir(self, testdir): result = testdir.runpython(p) assert not result.ret + def test_removing_cwd(self, testdir): + testdir.makepyfile(""" + def test_deleting_cwd(tmpdir, monkeypatch): + work = tmpdir.mkdir("work") + monkeypatch.chdir(work) + work.remove() + # Actual testing here + assert False + """) + result = testdir.runpytest() + assert result.ret == EXIT_TESTSFAILED + def test_issue109_sibling_conftests_not_loaded(self, testdir): sub1 = testdir.tmpdir.mkdir("sub1") sub2 = testdir.tmpdir.mkdir("sub2") @@ -678,4 +690,3 @@ def test_setup_function(self, testdir): * setup *test_1* * call *test_1* """) -