Skip to content

Commit 9248b77

Browse files
committed
use a global skip mark
1 parent 8ca1bba commit 9248b77

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

tests/electronic_structure/test_boltztrap2.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@
2424
VasprunLoader,
2525
)
2626

27-
BOLTZTRAP2_PRESENT = True
2827
except BoltztrapError:
29-
BOLTZTRAP2_PRESENT = False
30-
28+
pytest.skip("No boltztrap2", allow_module_level=True)
3129

3230
TEST_DIR = f"{TEST_FILES_DIR}/electronic_structure/boltztrap2"
3331

@@ -44,7 +42,6 @@
4442
BZT_TRANSP_FN = f"{TEST_DIR}/bztTranspProps.json.gz"
4543

4644

47-
@pytest.mark.skipif(not BOLTZTRAP2_PRESENT, reason="No boltztrap2, skipping tests.")
4845
class TestVasprunBSLoader(TestCase):
4946
def setUp(self):
5047
self.loader = VasprunBSLoader(VASP_RUN)
@@ -84,7 +81,6 @@ def test_get_volume(self):
8481
assert self.loader.get_volume() == approx(477.6256714925874, abs=1e-5)
8582

8683

87-
@pytest.mark.skipif(not BOLTZTRAP2_PRESENT, reason="No boltztrap2, skipping tests.")
8884
class TestBandstructureLoader(TestCase):
8985
def setUp(self):
9086
self.loader = BandstructureLoader(BAND_STRUCT, VASP_RUN.structures[-1])
@@ -112,7 +108,6 @@ def test_set_upper_lower_bands(self):
112108
assert self.loader_sp_dn.ebands.shape == (14, 198)
113109

114110

115-
@pytest.mark.skipif(not BOLTZTRAP2_PRESENT, reason="No boltztrap2, skipping tests.")
116111
class TestVasprunLoader(TestCase):
117112
def setUp(self):
118113
self.loader = VasprunLoader(VASP_RUN)
@@ -132,7 +127,6 @@ def test_from_file(self):
132127
assert self.loader is not None
133128

134129

135-
@pytest.mark.skipif(not BOLTZTRAP2_PRESENT, reason="No boltztrap2, skipping tests.")
136130
class TestBztInterpolator(TestCase):
137131
def setUp(self):
138132
self.loader = VasprunBSLoader(VASP_RUN)
@@ -210,7 +204,6 @@ def test_tot_proj_dos(self):
210204
assert pdos == approx(272.194174, abs=1e-5)
211205

212206

213-
@pytest.mark.skipif(not BOLTZTRAP2_PRESENT, reason="No boltztrap2, skipping tests.")
214207
class TestBztTransportProperties(TestCase):
215208
def setUp(self):
216209
with ScratchDir("."):
@@ -328,7 +321,6 @@ def test_compute_properties_doping(self):
328321
assert self.bztTransp_sp.contain_props_doping
329322

330323

331-
@pytest.mark.skipif(not BOLTZTRAP2_PRESENT, reason="No boltztrap2, skipping tests.")
332324
class TestBztPlotter:
333325
def test_plot(self):
334326
loader = VasprunBSLoader(VASP_RUN)

0 commit comments

Comments
 (0)