1
0
Fork 0
mirror of https://git.freebsd.org/ports.git synced 2025-06-29 16:40:31 -04:00
ports/math/py-pandas/files/print_skipped.py
Ruslan Makhmatkhanov bedee53426 math/py-pandas: update to 0.13.1
- update to 0.13.1
- remove lang/cython from BUILD_DEPENDS now that distfile is fixed
- include RUN_DEPENDS in TEST_DEPENDS
- add devel/py-boto to TEST_DEPENDS for completeness with pkg-message
- remove math/py-statsmodels from TEST_DEPENDS to break circular dependency
- Fix regression-test target to work with non-GitHub distfile which omits
  the ci/ directory. Borrow the print_skipped.py script to do this.

PR:		186802
Submitted by:	John W. O'Brien <john@saltant.com> (maintainer)
2014-03-04 10:17:29 +00:00

51 lines
1.4 KiB
Python

#!/usr/bin/env python
import sys
import math
import xml.etree.ElementTree as et
def parse_results(filename):
tree = et.parse(filename)
root = tree.getroot()
skipped = []
current_class = old_class = ''
i = 1
assert i - 1 == len(skipped)
for el in root.findall('testcase'):
cn = el.attrib['classname']
for sk in el.findall('skipped'):
old_class = current_class
current_class = cn
name = '{classname}.{name}'.format(classname=current_class,
name=el.attrib['name'])
msg = sk.attrib['message']
out = ''
if old_class != current_class:
ndigits = int(math.log(i, 10) + 1)
out += ('-' * (len(name + msg) + 4 + ndigits) + '\n') # 4 for : + space + # + space
out += '#{i} {name}: {msg}'.format(i=i, name=name, msg=msg)
skipped.append(out)
i += 1
assert i - 1 == len(skipped)
assert i - 1 == len(skipped)
assert len(skipped) == int(root.attrib['skip'])
return '\n'.join(skipped)
def main(args):
print('SKIPPED TESTS:')
print(parse_results(args.filename))
return 0
def parse_args():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('filename', help='XUnit file to parse')
return parser.parse_args()
if __name__ == '__main__':
sys.exit(main(parse_args()))