forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
Tips & Tricks for pandas dev
jreback edited this page May 18, 2014
·
2 revisions
In [1]: from distutils.version import LooseVersion
In [2]: LooseVersion(np.__version__)>='1.7.0'
Out[2]: Trueimport nose
try:
import a_module
except ImportError:
raise nose.SkipTest("message why this test is being skipped")Note: We implore you to write a message in the raise nose.SkipTest statement/expression so that when testing we can see why things were skipped without having to go back and look at the code. See below for a way to print out skipped tests after running nosetests.
nosetests -Isome_test_namenosetests -x# stores ids
nosetests --with-ids
# runs only tests that previously failed
nosetests --failednosetests -w pandas --with-xunit --xunit-file=/tmp/nosetests.xml
ci/print_skipped.py /tmp/nosetests.xmlfrom pandas.io.common import urlopen
with urlopen('http://www.google.com') as url:
raw_text = url.read()from pandas.io.common import ZipFile
with ZipFile('file.zip') as zf:
raw_text = zf.read('file.txt')You can set the environment variable PANDAS_TESTING_MODE to deprecate to show any DeprecationWarning message. This is enabled in the travis builds for numpy 1.9 (and evenutally for the python 3.4 build).