Skip to content

Commit

Permalink
Added pytest skip for Hyperspy MRC errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewHerzing committed Mar 14, 2024
1 parent a3f370f commit 30ef226
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tomotools/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def test_load_dm_series(self):
assert stack.axes_manager[2].units == signal.axes_manager[2].units


# @pytest.mark.skipif(hspy_mrc_broken is True, reason="Hyperspy MRC reader broken")
@pytest.mark.skipif(hspy_mrc_broken is True, reason="Hyperspy MRC reader broken")
class TestSerialEM:
def test_load_serialem_series(self):
dirname = os.path.join(tomotools_path, "tests",
Expand Down
20 changes: 19 additions & 1 deletion tomotools/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,31 @@
import pytest
import numpy
from tomotools.base import TomoStack
# import hyperspy.api as hs
import hyperspy.api as hs
import os
import glob

tomotools_path = os.path.dirname(tomotools.__file__)


def hspy_mrc_reader_check():
dirname = os.path.join(tomotools_path, "tests",
"test_data", "SerialEM_Multiframe_Test")
files = glob.glob(dirname + "/*.mrc")
file = files[0]
s = hs.load(file)
return s


try:
hspy_mrc_reader_check()
except TypeError:
hspy_mrc_broken = True
else:
hspy_mrc_broken = False


@pytest.mark.skipif(hspy_mrc_broken is True, reason="Hyperspy MRC reader broken")
class TestMultiframeAverage:
def test_register_serialem_stack(self):
dirname = os.path.join(tomotools_path, "tests",
Expand Down

0 comments on commit 30ef226

Please sign in to comment.