Skip to content

Commit fa70544

Browse files
committed
run.txt, test.txt, debug.py, run.py
1 parent 52d3358 commit fa70544

File tree

4 files changed

+74
-0
lines changed

4 files changed

+74
-0
lines changed

requirements/run.txt

Whitespace-only changes.

requirements/test.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
flake8
2+
pytest
3+
codecov
4+
coverage
5+
pytest-env

src/diffpy/labpdfproc/tests/debug.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env python
2+
##############################################################################
3+
#
4+
# (c) 2024 The Trustees of Columbia University in the City of New York.
5+
# All rights reserved.
6+
#
7+
# File coded by: Billinge Group members and community contributors.
8+
#
9+
# See GitHub contributions for a more detailed list of contributors.
10+
# https://github.com/diffpy/diffpy.labpdfproc/graphs/contributors
11+
#
12+
# See LICENSE.rst for license information.
13+
#
14+
##############################################################################
15+
16+
"""
17+
Convenience module for debugging the unit tests using
18+
19+
python -m diffpy.labpdfproc.tests.debug
20+
21+
Exceptions raised by failed tests or other errors are not caught.
22+
"""
23+
24+
25+
if __name__ == "__main__":
26+
import sys
27+
28+
from diffpy.labpdfproc.tests import testsuite
29+
30+
pattern = sys.argv[1] if len(sys.argv) > 1 else ""
31+
suite = testsuite(pattern)
32+
suite.debug()
33+
34+
35+
# End of file

src/diffpy/labpdfproc/tests/run.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env python
2+
##############################################################################
3+
#
4+
# (c) 2024 The Trustees of Columbia University in the City of New York.
5+
# All rights reserved.
6+
#
7+
# File coded by: Billinge Group members and community contributors.
8+
#
9+
# See GitHub contributions for a more detailed list of contributors.
10+
# https://github.com/diffpy/diffpy.labpdfproc/graphs/contributors
11+
#
12+
# See LICENSE.rst for license information.
13+
#
14+
##############################################################################
15+
"""Convenience module for executing all unit tests with
16+
python -m diffpy.labpdfproc.tests.run
17+
"""
18+
19+
import sys
20+
21+
import pytest
22+
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+
34+
# End of file

0 commit comments

Comments
 (0)