From 41c85846aa7f92ee9b8ccf419c292b42a91334de Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Tue, 8 Mar 2016 19:14:40 -0500 Subject: [PATCH] TST: nicer output from pd.test() TST: skip result2 test in computation/test_eval.py as unreliable TST: skip options tests in io/tests/test_data.py --- pandas/computation/tests/test_eval.py | 4 +-- pandas/io/tests/test_data.py | 2 ++ pandas/util/nosetester.py | 37 +++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/pandas/computation/tests/test_eval.py b/pandas/computation/tests/test_eval.py index 518e5dd999391..97db171312557 100644 --- a/pandas/computation/tests/test_eval.py +++ b/pandas/computation/tests/test_eval.py @@ -1633,8 +1633,8 @@ def test_result_types(self): self.check_result_type(np.float64, np.float64) def test_result_types2(self): - # xref https://github.com/pydata/pandas/issues/12293 - tm._skip_if_windows() + # xref https://github.com/pydata/pandas/issues/12293 + raise nose.SkipTest("unreliable tests on complex128") # Did not test complex64 because DataFrame is converting it to # complex128. Due to https://github.com/pydata/pandas/issues/10952 diff --git a/pandas/io/tests/test_data.py b/pandas/io/tests/test_data.py index c293ef5c9c2f6..d9c09fa788332 100644 --- a/pandas/io/tests/test_data.py +++ b/pandas/io/tests/test_data.py @@ -304,6 +304,7 @@ def setUpClass(cls): super(TestYahooOptions, cls).setUpClass() _skip_if_no_lxml() _skip_if_no_bs() + raise nose.SkipTest('unreliable test') # aapl has monthlies cls.aapl = web.Options('aapl', 'yahoo') @@ -370,6 +371,7 @@ def test_get_expiry_dates(self): @network def test_get_all_data(self): + try: data = self.aapl.get_all_data(put=True) except RemoteDataError as e: diff --git a/pandas/util/nosetester.py b/pandas/util/nosetester.py index 445cb79978fc1..a81fc5cd4b31e 100644 --- a/pandas/util/nosetester.py +++ b/pandas/util/nosetester.py @@ -122,6 +122,43 @@ def _get_custom_doctester(self): """ return None + def _test_argv(self, label, verbose, extra_argv): + ''' Generate argv for nosetest command + + Parameters + ---------- + label : {'fast', 'full', '', attribute identifier}, optional + see ``test`` docstring + verbose : int, optional + Verbosity value for test outputs, in the range 1-10. Default is 1. + extra_argv : list, optional + List with any extra arguments to pass to nosetests. + + Returns + ------- + argv : list + command line arguments that will be passed to nose + ''' + argv = [__file__, self.package_path] + if label and label != 'full': + if not isinstance(label, string_types): + raise TypeError('Selection label should be a string') + if label == 'fast': + label = 'not slow and not network and not disabled' + argv += ['-A', label] + argv += ['--verbosity', str(verbose)] + + # When installing with setuptools, and also in some other cases, the + # test_*.py files end up marked +x executable. Nose, by default, does + # not run files marked with +x as they might be scripts. However, in + # our case nose only looks for test_*.py files under the package + # directory, which should be safe. + argv += ['--exe'] + + if extra_argv: + argv += extra_argv + return argv + def test(self, label='fast', verbose=1, extra_argv=None, doctests=False, coverage=False, raise_warnings=None): """