mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-04-28 04:07:32 -07:00
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>
32 lines
803 B
Diff
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)
|