Skip to content

Commit 7dd12c8

Browse files
committed
switch back to unittest run for now
1 parent 46943fc commit 7dd12c8

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

Diff for: src/diffpy/srfit/tests/run.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
#!/usr/bin/env python
22
##############################################################################
33
#
4-
# (c) 2024 The Trustees of Columbia University in the City of New York.
5-
# All rights reserved.
4+
# diffpy.srfit by DANSE Diffraction group
5+
# Simon J. L. Billinge
6+
# (c) 2010 The Trustees of Columbia University
7+
# in the City of New York. All rights reserved.
68
#
7-
# File coded by: Billinge Group members and community contributors.
9+
# File coded by: Pavol Juhas
810
#
9-
# See GitHub contributions for a more detailed list of contributors.
10-
# https://github.com/diffpy/diffpy.srfit/graphs/contributors
11-
#
12-
# See LICENSE.rst for license information.
11+
# See AUTHORS.txt for a list of people who contributed.
12+
# See LICENSE_DANSE.txt for license information.
1313
#
1414
##############################################################################
15+
1516
"""Convenience module for executing all unit tests with
17+
1618
python -m diffpy.srfit.tests.run
1719
"""
1820

19-
import sys
20-
21-
import pytest
2221

23-
if __name__ == "__main__":
24-
# show output results from every test function
25-
args = ["-v"]
26-
# show the message output for skipped and expected failure tests
27-
if len(sys.argv) > 1:
28-
args.extend(sys.argv[1:])
29-
print("pytest arguments: {}".format(args))
30-
# call pytest and exit with the return code from pytest
31-
exit_res = pytest.main(args)
32-
sys.exit(exit_res)
22+
if __name__ == '__main__':
23+
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"
30+
from diffpy.srfit.tests import test
31+
# produce zero exit code for a successful test
32+
sys.exit(not test().wasSuccessful())
3333

3434
# End of file

0 commit comments

Comments
 (0)