diff options
| author | xoviat <xoviat@users.noreply.github.com> | 2017-12-22 11:57:34 -0600 |
|---|---|---|
| committer | xoviat <xoviat@users.noreply.github.com> | 2017-12-22 17:30:51 -0600 |
| commit | 59b073928f1bd521a58b756ef4293135d8bd3e29 (patch) | |
| tree | a4d44e890b8962099755a07ddf77cd43658c1670 /numpy | |
| parent | edb501db0ee21566de423ee571814bcf1111f2eb (diff) | |
| download | numpy-59b073928f1bd521a58b756ef4293135d8bd3e29.tar.gz | |
MAINT: Fix nose features to work on pytest
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/conftest.py | 21 | ||||
| -rw-r--r-- | numpy/ma/core.py | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/numpy/conftest.py b/numpy/conftest.py index ea4197049..d3db866a7 100644 --- a/numpy/conftest.py +++ b/numpy/conftest.py @@ -5,6 +5,7 @@ from __future__ import division, absolute_import, print_function import warnings import pytest +import numpy from numpy.core.multiarray_tests import get_fpu_mode @@ -52,3 +53,23 @@ def check_fpu_mode(request): raise AssertionError("FPU precision mode changed from {0:#x} to {1:#x}" " when collecting the test".format(old_mode, new_mode)) + + +def pytest_addoption(parser): + parser.addoption("--runslow", action="store_true", + default=False, help="run slow tests") + + +def pytest_collection_modifyitems(config, items): + if config.getoption("--runslow"): + # --runslow given in cli: do not skip slow tests + return + skip_slow = pytest.mark.skip(reason="need --runslow option to run") + for item in items: + if "slow" in item.keywords: + item.add_marker(skip_slow) + + +@pytest.fixture(autouse=True) +def add_np(doctest_namespace): + doctest_namespace['np'] = numpy diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 1edfba42e..fe092f552 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -6937,6 +6937,7 @@ def transpose(a, axes=None): [[False False] [False True]], fill_value = 999999) + >>> ma.transpose(x) masked_array(data = [[0 2] |
