blob: 36946527b2b2759d165f84a6f90e99a7957e4a54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)
|