| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Is there a reason that you run tests like scripts?
Sorry, something went wrong.
I just click "Run file" in my IDE, it is the easiest thing to do when testing something. |
Sorry, something went wrong.
There was a problem hiding this comment.
Historically unittest.main() was added on demand during unit tests debugging.
Thanks for spreading it everywhere.
Sorry, something went wrong.
|
@asvetlov: Please replace # with GH- in the commit message next time. Thanks! |
Sorry, something went wrong.
(cherry picked from commit 5a53400) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
GH-30782 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
(cherry picked from commit 5a53400) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
GH-30783 is a backport of this pull request to the 3.9 branch. |
Sorry, something went wrong.
(cherry picked from commit 5a53400) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
| Back | FazBrowse Home | New Git URL |
Right now some tests in test_asyncio are suitable to be executed directly as python Lib/test/test_asyncio/test_X.py and some are only executable with -m test or -m Lib/test/test_asyncio.
cpython/Lib/test/test_asyncio/test_asyncio_waitfor.py
Lines 60 to 61 in c02e860
cpython/Lib/test/test_asyncio/test_context.py
Lines 33 to 34 in c02e860
This does not look good to me.
So, I've fixed several tests modules in test_asyncio when invoked directly as python module_name.py
There were two major problems:
The best way to illustrate this problem is to show Lib/test/test_asyncio/test_runners.py:
Step 1. No changes.
» ./python.exe Lib/test/test_asyncio/test_runners.py Traceback (most recent call last): File "/Users/sobolev/Desktop/cpython/Lib/test/test_asyncio/test_runners.py", line 5, in <module> from . import utils as test_utils ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: attempted relative import with no known parent packageStep 2. Fixed relative import.
(nothing happens)
Step 3. With unottest.main():
CC @corona10 as my mentor.
https://bugs.python.org/issue46425