Skip to content

Commit

Permalink
Adds capability to mark tests as slow
Browse files Browse the repository at this point in the history
  • Loading branch information
pwolfram committed Mar 28, 2017
1 parent 371d034 commit c1071ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pytest

def pytest_addoption(parser):
parser.addoption("--skip-slow", action="store_true",
help="skips slow tests")
6 changes: 6 additions & 0 deletions xarray/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ def requires_bottleneck(test):
return test if has_bottleneck else pytest.mark.skip('requires bottleneck')(test)


slow = pytest.mark.skipif(
pytest.config.getoption("--skip-slow"),
reason="set --skip-slow option to skip slow tests"
)


class TestCase(unittest.TestCase):
if PY3:
# Python 3 assertCountEqual is roughly equivalent to Python 2
Expand Down

0 comments on commit c1071ba

Please sign in to comment.