-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix importorskip in test_hooks; add tmp_cwd fixture
- Loading branch information
1 parent
fea26c0
commit 01881d4
Showing
2 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture() | ||
def tmp_cwd(tmp_path): | ||
"""Perform test in a pristine temporary working directory.""" | ||
old_dir = Path.cwd() | ||
os.chdir(tmp_path) | ||
try: | ||
yield tmp_path | ||
finally: | ||
os.chdir(old_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters