Skip to content

Commit 6b953d6

Browse files
committed
Merge commit 'v0.12.0rc1-101-gd070a1f' into debian
* commit 'v0.12.0rc1-101-gd070a1f': TST/CI: add scikits.timeseries wheel back TST: skip if no html5lib since bs4 needs it CLN: define __hash__ directly for _NaT; needed for some builds on py3k TST: add message to nose.SkipTest TST/BLD: add testing for bad bs4 version BLD/TST/CI: add script to show skipped tests at the end of a build
2 parents e69b013 + d070a1f commit 6b953d6

File tree

9 files changed

+71
-14
lines changed

9 files changed

+71
-14
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ script:
4949

5050
after_script:
5151
- ci/print_versions.py
52+
- ci/print_skipped.py /tmp/nosetests.xml

ci/print_skipped.py

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env python
2+
3+
import sys
4+
import math
5+
import xml.etree.ElementTree as et
6+
7+
8+
def parse_results(filename):
9+
tree = et.parse(filename)
10+
root = tree.getroot()
11+
skipped = []
12+
13+
current_class = old_class = ''
14+
i = 1
15+
assert i - 1 == len(skipped)
16+
for el in root.findall('testcase'):
17+
cn = el.attrib['classname']
18+
for sk in el.findall('skipped'):
19+
old_class = current_class
20+
current_class = cn
21+
name = '{classname}.{name}'.format(classname=current_class,
22+
name=el.attrib['name'])
23+
msg = sk.attrib['message']
24+
out = ''
25+
if old_class != current_class:
26+
ndigits = int(math.log(i, 10) + 1)
27+
out += ('-' * (len(name + msg) + 4 + ndigits) + '\n') # 4 for : + space + # + space
28+
out += '#{i} {name}: {msg}'.format(i=i, name=name, msg=msg)
29+
skipped.append(out)
30+
i += 1
31+
assert i - 1 == len(skipped)
32+
assert i - 1 == len(skipped)
33+
assert len(skipped) == int(root.attrib['skip'])
34+
return '\n'.join(skipped)
35+
36+
37+
def main(args):
38+
print('SKIPPED TESTS:')
39+
print(parse_results(args.filename))
40+
return 0
41+
42+
43+
def parse_args():
44+
import argparse
45+
parser = argparse.ArgumentParser()
46+
parser.add_argument('filename', help='XUnit file to parse')
47+
return parser.parse_args()
48+
49+
50+
if __name__ == '__main__':
51+
sys.exit(main(parse_args()))

ci/requirements-2.6.txt

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ numpy==1.6.1
22
cython==0.19.1
33
python-dateutil==2.1
44
pytz==2013b
5+
http://www.crummy.com/software/BeautifulSoup/bs4/download/4.2/beautifulsoup4-4.2.0.tar.gz
6+
html5lib==1.0b2

ci/requirements-2.7.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ xlrd==0.9.2
1212
patsy==0.1.0
1313
html5lib==1.0b2
1414
lxml==3.2.1
15-
http://downloads.sourceforge.net/project/pytseries/scikits.timeseries/0.91.3/scikits.timeseries-0.91.3.tar.gz?r=
15+
scikits.timeseries==0.91.3
1616
MySQL-python==1.2.4
1717
scipy==0.10.0
1818
beautifulsoup4==4.2.1

ci/script.sh

+2-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,5 @@ if [ x"$LOCALE_OVERRIDE" != x"" ]; then
99

1010
fi
1111

12-
echo nosetests --exe -w /tmp -A "$NOSE_ARGS" pandas;
13-
nosetests --exe -w /tmp -A "$NOSE_ARGS" pandas;
14-
15-
# if [ x"$VBENCH" == x"true" ]; then
16-
# python vb_suite/perf_HEAD.py;
17-
# exit
18-
# fi
12+
echo nosetests --exe -w /tmp -A "$NOSE_ARGS" pandas --with-xunit --xunit-file=/tmp/nosetests.xml
13+
nosetests --exe -w /tmp -A "$NOSE_ARGS" pandas --with-xunit --xunit-file=/tmp/nosetests.xml

doc/source/release.rst

+1
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ pandas 0.12
341341
(:issue:`4226`)
342342
- Fixed bug in initializing ``DatetimeIndex`` with an array of strings
343343
in a certain time zone (:issue:`4229`)
344+
- Fixed bug where html5lib wasn't being properly skipped (:issue:`4265`)
344345

345346
pandas 0.11.0
346347
=============

doc/source/v0.12.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ Bug Fixes
474474
(:issue:`4226`)
475475
- Fixed bug in initializing ``DatetimeIndex`` with an array of strings
476476
in a certain time zone (:issue:`4229`)
477+
- Fixed bug where html5lib wasn't being properly skipped (:issue:`4265`)
477478

478479
See the :ref:`full release notes
479480
<release>` or issue tracker

pandas/io/tests/test_html.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _have_module(module_name):
3737

3838
def _skip_if_no(module_name):
3939
if not _have_module(module_name):
40-
raise nose.SkipTest
40+
raise nose.SkipTest("{0} not found".format(module_name))
4141

4242

4343
def _skip_if_none_of(module_names):
@@ -46,14 +46,16 @@ def _skip_if_none_of(module_names):
4646
if module_names == 'bs4':
4747
import bs4
4848
if bs4.__version__ == LooseVersion('4.2.0'):
49-
raise nose.SkipTest
49+
raise nose.SkipTest("Bad version of bs4: 4.2.0")
5050
else:
51-
if not all(_have_module(module_name) for module_name in module_names):
52-
raise nose.SkipTest
51+
not_found = [module_name for module_name in module_names if not
52+
_have_module(module_name)]
53+
if not_found == module_names:
54+
raise nose.SkipTest("{0} not found".format(not_found))
5355
if 'bs4' in module_names:
5456
import bs4
5557
if bs4.__version__ == LooseVersion('4.2.0'):
56-
raise nose.SkipTest
58+
raise nose.SkipTest("Bad version of bs4: 4.2.0")
5759

5860

5961
DATA_PATH = get_data_path()
@@ -75,7 +77,7 @@ def assert_framelist_equal(list1, list2, *args, **kwargs):
7577

7678

7779
def test_bs4_version_fails():
78-
_skip_if_no('bs4')
80+
_skip_if_none_of(('bs4', 'html5lib'))
7981
import bs4
8082
if bs4.__version__ == LooseVersion('4.2.0'):
8183
assert_raises(AssertionError, read_html, os.path.join(DATA_PATH,

pandas/tslib.pyx

+4
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,10 @@ cdef inline bint is_timestamp(object o):
581581

582582
cdef class _NaT(_Timestamp):
583583

584+
def __hash__(_NaT self):
585+
# py3k needs this defined here
586+
return hash(self.value)
587+
584588
def __richcmp__(_NaT self, object other, int op):
585589
# if not isinstance(other, (_NaT, _Timestamp)):
586590
# raise TypeError('Cannot compare %s with NaT' % type(other))

0 commit comments

Comments
 (0)