Skip to content

Commit

Permalink
skips test_exactly1 if more_itertools not available
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasohara committed Jan 15, 2024
1 parent bce410a commit dcd46b0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mezcla/tests/test_misc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
# THE_MODULE: global module object
import mezcla.misc_utils as THE_MODULE

# Make sure more_itertools available
has_more_itertools = True
try:
import more_itertools
except:
system.print_exception_info("more_itertools import")
has_more_itertools = False

class TestMiscUtils:
"""Class for test case definitions"""

Expand Down Expand Up @@ -142,6 +150,7 @@ def test_trace_named_objects(self, capsys):
assert "len(sys.argv)" in captured.err
assert "sys.argv" in captured.err

@pytest.mark.skipif(not has_more_itertools, reason="Unable to load more_itertools")
def test_exactly1(self):
"""Ensure exactly1 works as expected"""
debug.trace(4, "test_exactly1()")
Expand Down

0 comments on commit dcd46b0

Please sign in to comment.