55boiler plate for doing that is to put the following in the module
66``__init__.py`` file::
77
8- from numpy ._pytesttester import PytestTester
8+ from pywt ._pytesttester import PytestTester
99 test = PytestTester(__name__).test
1010 del PytestTester
1111
1212
1313Warnings filtering and other runtime settings should be dealt with in the
14- ``pytest.ini`` file in the numpy repo root. The behavior of the test depends on
14+ ``pytest.ini`` file in the pywt repo root. The behavior of the test depends on
1515whether or not that file is found as follows:
1616
1717* ``pytest.ini`` is present (develop mode)
2020 DeprecationWarnings and PendingDeprecationWarnings are ignored, other
2121 warnings are passed through.
2222
23- In practice, tests run from the numpy repo are run in develop mode. That
23+ In practice, tests run from the PyWavelets repo are run in develop mode. That
2424includes the standard ``python runtests.py`` invocation.
2525
26- This module is imported by every numpy subpackage, so lies at the top level to
27- simplify circular import issues. For the same reason, it contains no numpy
28- imports at module scope, instead importing numpy within function calls.
2926"""
3027from __future__ import division , absolute_import , print_function
3128
3532__all__ = ['PytestTester' ]
3633
3734
38-
39- def _show_numpy_info ():
40- import numpy as np
41-
42- print ("NumPy version %s" % np .__version__ )
43- relaxed_strides = np .ones ((10 , 1 ), order = "C" ).flags .f_contiguous
44- print ("NumPy relaxed strides checking option:" , relaxed_strides )
35+ def _show_pywt_info ():
36+ import pywt
37+ from pywt ._c99_config import _have_c99_complex
38+ print ("PyWavelets version %s" % pywt .__version__ )
39+ if _have_c99_complex :
40+ print ("Compiled with C99 complex support." )
41+ else :
42+ print ("Compiled without C99 complex support." )
4543
4644
4745class PytestTester (object ):
4846 """
4947 Pytest test runner.
5048
51- This class is made available in ``numpy .testing``, and a test function
49+ This class is made available in ``pywt .testing``, and a test function
5250 is typically added to a package's __init__.py like so::
5351
54- from numpy .testing import PytestTester
52+ from pywt .testing import PytestTester
5553 test = PytestTester(__name__).test
5654 del PytestTester
5755
@@ -103,13 +101,6 @@ def __call__(self, label='fast', verbose=1, extra_argv=None,
103101 result : bool
104102 Return True on success, false otherwise.
105103
106- Notes
107- -----
108- Each NumPy module exposes `test` in its namespace to run all tests for
109- it. For example, to run all tests for numpy.lib:
110-
111- >>> np.lib.test() #doctest: +SKIP
112-
113104 Examples
114105 --------
115106 >>> result = np.lib.test() #doctest: +SKIP
@@ -120,14 +111,6 @@ def __call__(self, label='fast', verbose=1, extra_argv=None,
120111
121112 """
122113 import pytest
123- import warnings
124-
125- #FIXME This is no longer needed? Assume it was for use in tests.
126- # cap verbosity at 3, which is equivalent to the pytest '-vv' option
127- #from . import utils
128- #verbose = min(int(verbose), 3)
129- #utils.verbose = verbose
130- #
131114
132115 module = sys .modules [self .module_name ]
133116 module_path = os .path .abspath (module .__path__ [0 ])
@@ -138,39 +121,12 @@ def __call__(self, label='fast', verbose=1, extra_argv=None,
138121 # offset verbosity. The "-q" cancels a "-v".
139122 pytest_args += ["-q" ]
140123
141- # Filter out distutils cpu warnings (could be localized to
142- # distutils tests). ASV has problems with top level import,
143- # so fetch module for suppression here.
144- with warnings .catch_warnings ():
145- warnings .simplefilter ("always" )
146- from numpy .distutils import cpuinfo
147-
148124 # Filter out annoying import messages. Want these in both develop and
149125 # release mode.
150126 pytest_args += [
151127 "-W ignore:Not importing directory" ,
152128 "-W ignore:numpy.dtype size changed" ,
153- "-W ignore:numpy.ufunc size changed" ,
154- "-W ignore::UserWarning:cpuinfo" ,
155- ]
156-
157- # When testing matrices, ignore their PendingDeprecationWarnings
158- pytest_args += [
159- "-W ignore:the matrix subclass is not" ,
160- ]
161-
162- # Ignore python2.7 -3 warnings
163- pytest_args += [
164- r"-W ignore:sys\.exc_clear\(\) not supported in 3\.x:DeprecationWarning" ,
165- r"-W ignore:in 3\.x, __setslice__:DeprecationWarning" ,
166- r"-W ignore:in 3\.x, __getslice__:DeprecationWarning" ,
167- r"-W ignore:buffer\(\) not supported in 3\.x:DeprecationWarning" ,
168- r"-W ignore:CObject type is not supported in 3\.x:DeprecationWarning" ,
169- r"-W ignore:comparing unequal types not supported in 3\.x:DeprecationWarning" ,
170- r"-W ignore:the commands module has been removed in Python 3\.0:DeprecationWarning" ,
171- r"-W ignore:The 'new' module has been removed in Python 3\.0:DeprecationWarning" ,
172- ]
173-
129+ "-W ignore:numpy.ufunc size changed" , ]
174130
175131 if doctests :
176132 raise ValueError ("Doctests not supported" )
@@ -197,9 +153,8 @@ def __call__(self, label='fast', verbose=1, extra_argv=None,
197153
198154 pytest_args += ["--pyargs" ] + list (tests )
199155
200-
201156 # run tests.
202- _show_numpy_info ()
157+ _show_pywt_info ()
203158
204159 try :
205160 code = pytest .main (pytest_args )
0 commit comments