diff options
Diffstat (limited to 'dev-python/pyproj/files')
-rw-r--r-- | dev-python/pyproj/files/pyproj-2.4.2-conftest.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dev-python/pyproj/files/pyproj-2.4.2-conftest.patch b/dev-python/pyproj/files/pyproj-2.4.2-conftest.patch new file mode 100644 index 000000000000..36946527b2b2 --- /dev/null +++ b/dev-python/pyproj/files/pyproj-2.4.2-conftest.patch @@ -0,0 +1,31 @@ +--- a/test/conftest.py ++++ b/test/conftest.py +@@ -0,0 +1,28 @@ ++import os ++import shutil ++import tempfile ++ ++import pytest ++ ++import pyproj ++ ++ ++@pytest.fixture(scope="session") ++def aoi_data_directory(): ++ """ ++ This is to ensure that the ntv2_0.gsb file is actually ++ missing for the AOI tests. ++ """ ++ data_dir = pyproj.datadir.get_data_dir() ++ with tempfile.TemporaryDirectory() as tmpdir: ++ tmp_data_dir = os.path.join(tmpdir, "proj") ++ shutil.copytree(data_dir, tmp_data_dir) ++ try: ++ os.remove(os.path.join(str(tmp_data_dir), "ntv2_0.gsb")) ++ except OSError: ++ pass ++ try: ++ pyproj.datadir.set_data_dir(str(tmp_data_dir)) ++ yield ++ finally: ++ pyproj.datadir.set_data_dir(data_dir) |