From 20d2e846d6ba54c8630e6a56af099646e5e6d07f Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Tue, 5 Oct 2021 10:03:43 -0400 Subject: [PATCH] Check if cif2cell is available before running test Signed-off-by: Steven Hahn --- nexus/lib/versions.py | 4 ++++ nexus/tests/unit/test_structure.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nexus/lib/versions.py b/nexus/lib/versions.py index 687a561d79..d10b80e592 100644 --- a/nexus/lib/versions.py +++ b/nexus/lib/versions.py @@ -843,6 +843,7 @@ def check(self,write=True,exit=False,full=False,n=0,pad=' '): spglib_available = False pycifrw_available = False seekpath_available = False +cif2cell_available = False numpy_supported = False scipy_supported = False @@ -852,6 +853,7 @@ def check(self,write=True,exit=False,full=False,n=0,pad=' '): spglib_supported = False pycifrw_supported = False seekpath_supported = False +cif2cell_supported = False try: # versioning info is never worth failure versions = Versions() @@ -864,6 +866,7 @@ def check(self,write=True,exit=False,full=False,n=0,pad=' '): spglib_available = versions.available('spglib') pycifrw_available = versions.available('pycifrw') seekpath_available = versions.available('seekpath') + cif2cell_available = versions.available('cif2cell') numpy_supported = versions.supported('numpy') scipy_supported = versions.supported('scipy') @@ -873,6 +876,7 @@ def check(self,write=True,exit=False,full=False,n=0,pad=' '): spglib_supported = versions.supported('spglib') pycifrw_supported = versions.supported('pycifrw') seekpath_supported = versions.supported('seekpath') + cif2cell_available = versions.supported('cif2cell') except: versions = None #end try diff --git a/nexus/tests/unit/test_structure.py b/nexus/tests/unit/test_structure.py index 2137d643b4..acdbd6798d 100644 --- a/nexus/tests/unit/test_structure.py +++ b/nexus/tests/unit/test_structure.py @@ -676,7 +676,7 @@ def test_read_write(): -if versions.pycifrw_available: +if versions.pycifrw_available and versions.cif2cell_available: def test_read_cif(): """ Read La2CuO4 structure from a CIF file.