Skip to content

Commit 8d82902

Browse files
committed
Merge branch 'common-diffpy-patches'
2 parents ff1af6f + b9fa18b commit 8d82902

6 files changed

Lines changed: 16 additions & 8 deletions

File tree

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ exclude_lines =
1111
^[ ]*assert False
1212

1313
## Don't complain if non-runnable code isn't run:
14+
^[ ]*@unittest.skip\b
1415
^[ ]{4}unittest.main()
1516
if __name__ == .__main__.:
1617

.gitarchive.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[DEFAULT]
22
commit = $Format:%H$
3-
date = $Format:%ai$
4-
timestamp = $Format:%at$
3+
date = $Format:%ci$
4+
timestamp = $Format:%ct$
55
refnames = $Format:%D$

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ addons:
3434

3535
before_install:
3636
- MYNAME=diffpy.pdfgui
37+
- MYCOMMIT="$(git rev-parse HEAD)"
3738
- umask 022
3839
- git fetch origin --tags
3940
- if ${MYUSEMC}; then
@@ -62,7 +63,7 @@ before_install:
6263
- $NOMC || wget --timestamping ${MYMCREPO}/${MYMCBUNDLE}
6364
- $NOMC || test -x ~/mc/bin/conda || bash ${MYMCBUNDLE} -b -f -p ~/mc
6465
- $NOMC || popd
65-
- $NOMC || source ~/mc/bin/activate root
66+
- $NOMC || source ~/mc/bin/activate base
6667
- $NOMC || conda update --yes conda
6768
- $NOMC || conda install --yes conda-build jinja2
6869
- $NOMC || conda create --name=testenv --yes python=${MYPYTHON_VERSION} coverage
@@ -89,8 +90,8 @@ install:
8990

9091
- cd ${MYRUNDIR}
9192
- MYGIT_REV=$(python -c "import ${MYNAME}.version as v; print(v.__git_commit__)")
92-
- if [[ "${TRAVIS_COMMIT}" != "${MYGIT_REV}" ]]; then
93-
echo "Version mismatch ${TRAVIS_COMMIT} vs ${MYGIT_REV}.";
93+
- if [[ "${MYCOMMIT}" != "${MYGIT_REV}" ]]; then
94+
echo "Version mismatch ${MYCOMMIT} vs ${MYGIT_REV}.";
9495
exit 1;
9596
fi
9697

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def gitinfo():
2626
kw = dict(stdout=PIPE, cwd=MYDIR)
2727
proc = Popen(['git', 'describe', '--match=v[[:digit:]]*'], **kw)
2828
desc = proc.stdout.read()
29-
proc = Popen(['git', 'log', '-1', '--format=%H %at %ai'], **kw)
29+
proc = Popen(['git', 'log', '-1', '--format=%H %ct %ci'], **kw)
3030
glog = proc.stdout.read()
3131
rv = {}
3232
rv['version'] = '.post'.join(desc.strip().split('-')[:2]).lstrip('v')

src/diffpy/pdfgui/tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def testsuite(pattern=''):
5454
return suite_all
5555
tcases = chain.from_iterable(tsuites)
5656
for tc in tcases:
57-
tcwords = tc.id().rsplit('.', 2)
58-
shortname = '.'.join(tcwords[-2:])
57+
tcwords = tc.id().split('.')
58+
shortname = '.'.join(tcwords[-3:])
5959
if rx.search(shortname):
6060
suite.addTest(tc)
6161
# verify all tests are found for an empty pattern.

src/diffpy/pdfgui/tests/run.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121

2222
if __name__ == '__main__':
2323
import sys
24+
# show warnings by default
25+
if not sys.warnoptions:
26+
import os, warnings
27+
warnings.simplefilter("default")
28+
# also affect subprocesses
29+
os.environ["PYTHONWARNINGS"] = "default"
2430
from diffpy.pdfgui.tests import test
2531
# produce zero exit code for a successful test
2632
sys.exit(not test().wasSuccessful())

0 commit comments

Comments
 (0)