Skip to content

Commit 4b6c5d6

Browse files
committed
tests run.py and version.py
1 parent 1f63c40 commit 4b6c5d6

File tree

3 files changed

+38
-39
lines changed

3 files changed

+38
-39
lines changed

src/diffpy/__init__.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/env python
22
##############################################################################
33
#
4-
# diffpy by DANSE Diffraction group
5-
# Simon J. L. Billinge
6-
# (c) 2008 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.
86
#
9-
# File coded by: Pavol Juhas
7+
# File coded by: Billinge Group members and community contributors.
108
#
11-
# See AUTHORS.txt for a list of people who contributed.
12-
# See LICENSE.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.
1313
#
1414
##############################################################################
1515

@@ -22,5 +22,4 @@
2222

2323
__path__ = extend_path(__path__, __name__)
2424

25-
2625
# End of file

src/diffpy/pdfmorph/tests/run.py

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
#!/usr/bin/env python
22
##############################################################################
33
#
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.
86
#
9-
# File coded by: Pavol Juhas
7+
# File coded by: Billinge Group members and community contributors.
108
#
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.
1313
#
1414
##############################################################################
15-
1615
"""Convenience module for executing all unit tests with
17-
python -m diffpy.morphs.tests.run
16+
python -m diffpy.pdfmorph.tests.run
1817
"""
1918

19+
import sys
2020

21-
if __name__ == "__main__":
22-
import sys
21+
import pytest
2322

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)
3333

34-
# produce zero exit code for a successful test
35-
sys.exit(not test().wasSuccessful())
34+
# End of file

src/diffpy/pdfmorph/version.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
#!/usr/bin/env python
22
##############################################################################
33
#
4-
# Structure by DANSE Diffraction group
5-
# Simon J. L. Billinge
6-
# (c) 2008 trustees of the Michigan State University.
7-
# All rights reserved.
4+
# (c) 2024 The Trustees of Columbia University in the City of New York.
5+
# All rights reserved.
86
#
9-
# File coded by: Pavol Juhas
7+
# File coded by: Billinge Group members and community contributors.
108
#
11-
# See AUTHORS.txt for a list of people who contributed.
12-
# See LICENSE.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.
1313
#
1414
##############################################################################
1515

16-
"""Definition of __version__ for diffpy.pdfmorph.
17-
"""
16+
"""Definition of __version__."""
1817

18+
# We do not use the other three variables, but can be added back if needed.
19+
# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"]
1920

2021
# obtain version information
2122
from importlib.metadata import version

0 commit comments

Comments
 (0)