|
1 | 1 | #!/usr/bin/env python |
2 | 2 | ############################################################################## |
3 | 3 | # |
4 | | -# diffpy.structure by DANSE Diffraction group |
5 | | -# Simon J. L. Billinge |
6 | | -# (c) 2010 Trustees of the Columbia University |
7 | | -# in the City of New York. All rights reserved. |
| 4 | +# (c) 2024 The Trustees of Columbia University in the City of New York. |
| 5 | +# All rights reserved. |
8 | 6 | # |
9 | | -# File coded by: Pavol Juhas |
| 7 | +# File coded by: Billinge Group members and community contributors. |
10 | 8 | # |
11 | | -# See AUTHORS.txt for a list of people who contributed. |
12 | | -# See LICENSE_DANSE.txt for license information. |
| 9 | +# See GitHub contributions for a more detailed list of contributors. |
| 10 | +# https://github.com/diffpy/diffpy.pdfmorph/graphs/contributors |
| 11 | +# |
| 12 | +# See LICENSE.rst for license information. |
13 | 13 | # |
14 | 14 | ############################################################################## |
15 | | - |
16 | 15 | """Convenience module for executing all unit tests with |
17 | | -python -m diffpy.morphs.tests.run |
| 16 | +python -m diffpy.pdfmorph.tests.run |
18 | 17 | """ |
19 | 18 |
|
| 19 | +import sys |
20 | 20 |
|
21 | | -if __name__ == "__main__": |
22 | | - import sys |
| 21 | +import pytest |
23 | 22 |
|
24 | | - # show warnings by default |
25 | | - if not sys.warnoptions: |
26 | | - import os |
27 | | - import warnings |
28 | | - |
29 | | - warnings.simplefilter("default") |
30 | | - # also affect subprocesses |
31 | | - os.environ["PYTHONWARNINGS"] = "default" |
32 | | - from diffpy.pdfmorph.tests import test |
| 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) |
33 | 33 |
|
34 | | - # produce zero exit code for a successful test |
35 | | - sys.exit(not test().wasSuccessful()) |
| 34 | +# End of file |
0 commit comments