gentoo/dev-python/pyproj/files/pyproj-2.4.2-conftest.patch
Chris Mayo a61a895292
dev-python/pyproj: bump to 2.4.2
Package-Manager: Portage-2.3.79, Repoman-2.3.16
Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/13924
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2019-12-08 19:42:09 +01:00

32 lines
803 B
Diff

--- 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)