From 38aea5e6cae59468ff96f3fe56583cccde52495e Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Wed, 29 Jan 2025 20:50:33 +0100 Subject: [PATCH] skip if no enumlib --- tests/analysis/magnetism/test_analyzer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/analysis/magnetism/test_analyzer.py b/tests/analysis/magnetism/test_analyzer.py index af1ed96fafb..a40361393c1 100644 --- a/tests/analysis/magnetism/test_analyzer.py +++ b/tests/analysis/magnetism/test_analyzer.py @@ -19,9 +19,9 @@ TEST_DIR = f"{TEST_FILES_DIR}/analysis/magnetic_orderings" -enum_cmd = which("enum.x") or which("multienum.x") -makestr_cmd = which("makestr.x") or which("makeStr.x") or which("makeStr.py") -enumlib_present = enum_cmd and makestr_cmd +ENUM_CMD = which("enum.x") or which("multienum.x") +MAKESTR_CMD = which("makestr.x") or which("makeStr.x") or which("makeStr.py") +ENUMLIB_PRESENT = ENUM_CMD and MAKESTR_CMD class TestCollinearMagneticStructureAnalyzer(TestCase): @@ -259,8 +259,8 @@ def test_missing_spin(self): assert msa.structure.site_properties["magmom"] == [-5, 5, 0, 0] +@pytest.mark.skipif(not ENUMLIB_PRESENT, reason="enumlib not present") class TestMagneticStructureEnumerator: - @pytest.mark.skipif(not enumlib_present, reason="enumlib not present") def test_ordering_enumeration(self): # simple AFM structure = Structure.from_file(f"{TEST_DIR}/LaMnO3.json")