41 lines · 958 B · Python
RawDownload
"""This file imports test methods from different testing modules, in thisorder:     - try importing 'pytest'    - if it fails, fallback to 'numpy.testing' Nose2 support was removed because of lacking assertWarns on py2.7. """ import sys _has_pytest = False # check if we have pytesttry:    import pytest    parametrize = pytest.mark.parametrize    assert_raises = pytest.raises    assert_warns = pytest.warns    skipTest = pytest.skip    _has_pytest = True    def run_module_suite():        import sys, pytest        pytest.main(sys.argv)except:    pass # otherwise fallback on numpy.testingif not _has_pytest:    from numpy.testing import dec, assert_raises, assert_warns    from numpy.testing import SkipTest    parametrize = dec.parametrize    def skipTest(msg):        raise SkipTest(msg)    from numpy.testing import run_module_suite # always use numpy's assert_equalimport numpyassert_equal = numpy.testing.assert_equal

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t