Closed Tieqiong closed 3 weeks ago
We want to run tests using pytest moving forward. @Sparks29032 do we want to modify (get rid of) anything here before merging?
Shoot, I missed the notification on this thread! I think we actually want to keep __init__.py
blank. Let me check if we can remove this from diffpy.utils
.
@Tieqiong @sbillinge I think we keep __init__.py
blank and change run.py
to
#!/usr/bin/env python
##############################################################################
#
# (c) {% now 'utc', '%Y' %} The Trustees of Columbia University in the City of New York.
# All rights reserved.
#
# File coded by: Billinge Group members and community contributors.
#
# See GitHub contributions for a more detailed list of contributors.
# https://github.com/{{ cookiecutter.github_org }}/{{ cookiecutter.repo_name }}/graphs/contributors
#
# See LICENSE.rst for license information.
#
##############################################################################
"""Convenience module for executing all unit tests with
python -m {{ cookiecutter.project_name }}.tests.run
"""
import sys
import pytest
if __name__ == "__main__":
# show output results from every test function
args = ["-v"]
# show the message output for skipped and expected failure tests
if len(sys.argv) > 1:
args.extend(sys.argv[1:])
print("pytest arguments: {}".format(args))
# call pytest and exit with the return code from pytest
exit_res = pytest.main(args)
sys.exit(exit_res)
# End of file
This preserves python -m <package>.tests.run
. @Tieqiong make sure after building you test the package with pytest
. I tested locally and it seems fine, but I would like a second look.
closing, see #71
@Tieqiong what is the reason why you are closing this? I understand that you replaced it with a new PR. We sometimes do that when a PR gets a messy history we don't want, for example, but I just want to double check that you know it is ok to work on PRs till they are fixed in general. We don't have to always close them.
fix #25