Skip to content

Commit

Permalink
Merge pull request #225 from xylar/fix-test-features-and-tags
Browse files Browse the repository at this point in the history
Fix test_features_and_tags
  • Loading branch information
xylar authored Dec 22, 2024
2 parents 6d6274f + b507df5 commit 0b45cc9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion dev-spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Base
python>=3.9
cartopy
importlib_resources
matplotlib-base
numpy
progressbar2
Expand Down
14 changes: 11 additions & 3 deletions geometric_features/test/test_features_and_tags.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
import difflib
import os
from importlib.resources import files as imp_res_files

from geometric_features.test import TestCase
import pytest

from geometric_features.test import TestCase, loaddatadir # noqa: F401
from geometric_features.utils import write_feature_names_and_tags


@pytest.mark.usefixtures('loaddatadir')
class TestFeaturesAndTags(TestCase):

def test_features_and_tags(self):
if 'GEOMETRIC_DATA_DIR' in os.environ:
cache_location = os.environ['GEOMETRIC_DATA_DIR']
else:
cache_location = './geometric_data'
cache_location = os.path.abspath('./geometric_data')

os.chdir(self.datadir)

write_feature_names_and_tags(cacheLocation=cache_location, quiet=True)
assert os.path.exists('features_and_tags.json')

filename1 = 'geometric_features/features_and_tags.json'
filename1 = str(imp_res_files('geometric_features') /
'features_and_tags.json')
filename2 = 'features_and_tags.json'
with open(filename1, 'r') as f:
lines1 = f.readlines()
Expand Down
1 change: 0 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ requirements:
run:
- python >=3.9
- cartopy
- importlib_resources
- matplotlib-base
- numpy
- progressbar2
Expand Down

0 comments on commit 0b45cc9

Please sign in to comment.