Skip to content

Commit

Permalink
Pass bool instead of int values to pytest.mark.skipif (#1398)
Browse files Browse the repository at this point in the history
  • Loading branch information
obi1kenobi committed Sep 28, 2020
1 parent d6794f5 commit e29149c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion arviz/tests/base_tests/test_diagnostics_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from .test_diagnostics import data # pylint: disable=unused-import

pytestmark = pytest.mark.skipif( # pylint: disable=invalid-name
(importlib.util.find_spec("numba") is None) & ~running_on_ci(),
(importlib.util.find_spec("numba") is None) and not running_on_ci(),
reason="test requires numba which is not installed",
)

Expand Down
14 changes: 7 additions & 7 deletions arviz/tests/base_tests/test_plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
from ..helpers import running_on_ci


# Check if Bokeh is installed
bokeh_installed = importlib.util.find_spec("bokeh") is not None # pylint: disable=invalid-name


@pytest.mark.parametrize(
"value, default, expected",
[
Expand Down Expand Up @@ -200,7 +204,7 @@ def test_filter_plotter_list_warning():


@pytest.mark.skipif(
(importlib.util.find_spec("bokeh") is None) & ~running_on_ci(),
not (bokeh_installed or running_on_ci()),
reason="test requires bokeh which is not installed",
)
def test_bokeh_import():
Expand Down Expand Up @@ -278,7 +282,7 @@ def test_mpl_dealiase_sel_kwargs():


@pytest.mark.skipif(
(importlib.util.find_spec("bokeh") is None) & ~running_on_ci(),
not (bokeh_installed or running_on_ci()),
reason="test requires bokeh which is not installed",
)
def test_bokeh_dealiase_sel_kwargs():
Expand All @@ -302,12 +306,8 @@ def test_bokeh_dealiase_sel_kwargs():
assert res["line_color"] == "red"


# Check if Bokeh is installed
bokeh_installed = importlib.util.find_spec("bokeh") is not None # pylint: disable=invalid-name


@pytest.mark.skipif(
not (bokeh_installed | running_on_ci()),
not (bokeh_installed or running_on_ci()),
reason="test requires bokeh which is not installed",
)
def test_set_bokeh_circular_ticks_labels():
Expand Down
2 changes: 1 addition & 1 deletion arviz/tests/base_tests/test_stats_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .test_stats import centered_eight, non_centered_eight # pylint: disable=unused-import

pytestmark = pytest.mark.skipif( # pylint: disable=invalid-name
(importlib.util.find_spec("numba") is None) & ~running_on_ci(),
(importlib.util.find_spec("numba") is None) and not running_on_ci(),
reason="test requires numba which is not installed",
)

Expand Down
2 changes: 1 addition & 1 deletion arviz/tests/base_tests/test_utils_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .test_utils import utils_with_numba_import_fail # pylint: disable=unused-import

pytestmark = pytest.mark.skipif( # pylint: disable=invalid-name
(importlib.util.find_spec("numba") is None) & ~running_on_ci(),
(importlib.util.find_spec("numba") is None) and not running_on_ci(),
reason="test requires numba which is not installed",
)

Expand Down

0 comments on commit e29149c

Please sign in to comment.