Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT, TST: remove usage of test.support #33

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

tylerjereddy
Copy link
Contributor

  • related to Check p11 #32 (comment) cc @clevelam

  • the test package in CPython is intended for internal use by the CPython development team only, and is subject to API changes without prior deprecation, as noted here: https://docs.python.org/3.11/library/test.html

  • test.support.run_unittest is not available in Python 3.11.7, but is available in some other versions of 3.11.x and 3.12.x; clearly depending on that is not really sane, so let's just remove the usage--this allows the full test suite to pass for me locally with 3.11.7

  • I don't think there was any good reason to keep those test_main() style blocks anyway--perhaps you can encourage developers to use pytest path/to/test_module.py, which will do the same thing (most/all OSS packages would suggest that at this point I think); if you have folks who were running the tests with python path/to/test_module.py they'd need to swap to using pytest for the incantation, but maybe that's something you can live with?

* the `test` package in CPython is intended for internal
use by the CPython development team only, and is subject
to API changes without prior deprecation, as noted here:
https://docs.python.org/3.11/library/test.html

* `test.support.run_unittest` is not available in Python
`3.11.7`, but is available in some other versions of `3.11.x`
and `3.12.x`; clearly depending on that is not really sane,
so let's just remove the usage--this allows the full test
suite to pass for me locally with `3.11.7`

* I don't think there was any good reason to keep those
`test_main()` style blocks anyway--perhaps you can encourage
developers to use `pytest path/to/test_module.py`, which
will do the same thing (most/all OSS packages would suggest
that at this point I think); if you have folks who were
running the tests with `python path/to/test_module.py` they'd
need to swap to using `pytest` for the incantation, but maybe
that's something you can live with?
@clevelam
Copy link
Collaborator

clevelam commented Jan 5, 2024

Thanks @tylerjereddy. I think I was using the mains way back when I first started this project to run the tests by hand. Given that pytest is the intended use case I don't see any reason not to remove these. Thanks for fixing this so quickly.

@clevelam clevelam merged commit 790cc69 into lanl:master Jan 5, 2024
3 checks passed
@tylerjereddy tylerjereddy deleted the treddy_py_311_7_fix branch January 29, 2024 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants