77b0ea8
031f871
@@ -0,0 +1,20 @@
+ import os
+ from pathlib import Path
+
+ import pytest
+ if [int(x) for x in pytest.__version__.split(".")] < [3, 9, 0]:
+ # the tmp_path fixture is only available in pytest >= 3.9.0
+ @pytest.fixture
+ def tmp_path(tmpdir):
+ return Path(tmpdir)
+ def tmp_path_cwd(tmp_path):
+ """Return a temporary path and change into it"""
+ old_wd = os.getcwd()
+ os.chdir(tmp_path)
+ yield tmp_path
+ os.chdir(old_wd)
@@ -1,5 +1,4 @@
import tarfile
- import os
import sqlite3
from pathlib import Path
from typing import Any, List, NamedTuple
@@ -14,14 +13,6 @@
TEST_DATA_DIR = HERE.parent / "test_data"
- @pytest.fixture
- def tmp_path_cwd(tmp_path):
- old_wd = os.getcwd()
- os.chdir(tmp_path)
- yield tmp_path
- os.chdir(old_wd)
-
def _test_tarfile_factory(tarfile_path):
"""Wrap tarfile.open() context manager for fixtures
Metadata Update from @nphilipp: - Request assigned
Pull-Request has been merged by smooge
Build succeeded.