diff options
| author | Roy Sommer <roy@sommer.co.il> | 2019-12-22 23:09:38 +0200 |
|---|---|---|
| committer | Roy Sommer <roy@sommer.co.il> | 2019-12-22 23:09:38 +0200 |
| commit | ea898f7bf45ca0f8667bd76d6718c6fff9961bd3 (patch) | |
| tree | a0b1ed5885ad6e97c411335fcc2c3e6e093df8f4 /tests/utils | |
| download | taskipy2-ea898f7bf45ca0f8667bd76d6718c6fff9961bd3.zip | |
initial commit
Diffstat (limited to 'tests/utils')
| -rw-r--r-- | tests/utils/__init__.py | 0 | ||||
| -rw-r--r-- | tests/utils/fixture.py | 15 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/utils/__init__.py diff --git a/tests/utils/fixture.py b/tests/utils/fixture.py new file mode 100644 index 0000000..7bc7df3 --- /dev/null +++ b/tests/utils/fixture.py @@ -0,0 +1,15 @@ +import tempfile +import shutil + +class FixtureTempDir: + def __init__(self, fixture_original_dir: str): + self._tmpdir: str = tempfile.mktemp() + shutil.copytree(fixture_original_dir, self._tmpdir) + + @property + def path(self): + return self._tmpdir + + def clean(self): + shutil.rmtree(self._tmpdir, ignore_errors=True) +
\ No newline at end of file |