Skip to content

Commit bde0741

Browse files
committed
Feature: changedir fixture
1 parent accfe6a commit bde0741

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

yhttp/dev/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.5.0'
1+
__version__ = '3.6.0'

yhttp/dev/fixtures.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ def cicd():
1919
return CICD
2020

2121

22+
@pytest.fixture
23+
def changedir():
24+
@contextlib.contextmanager
25+
def change(d):
26+
backup = os.getcwd()
27+
os.chdir(d)
28+
yield
29+
os.chdir(backup)
30+
31+
return change
32+
33+
2234
@pytest.fixture
2335
def tempdir():
2436
tdir = tempfile.mkdtemp()

0 commit comments

Comments
 (0)