mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Reduce what happens in `load_tests` so that the next change, moving the `Buffered*` tests to `test_bufferdio` is purely mechanical movement and updating imports. This adds two classes, one per I/O implementation, to act as dispatch to the implementation-specific mocks as well as module members. Previously the mappings CTestCase and PyTestCase provide were injected directly during `load_tests`. CTestCase and PyTestCase inherit from `unittest.TestCase` so when the split happens default test discovery will work for the classes in `test_bufferedio`. `test_general` keeps a manual test list for this refactoring; some of the tests (ex. `ProtocolsTest`) aren't currently run and fixing that + helpers to not be picked up is out of my current scope. CTestCase and PyTestCase have an `io` class member which points to the implementation meaning that can be removed from individual test cases which now inherit from them. This code is picking up `MockRawIO` which is defined globally in the module but these should use the mock specific to the I/O implementation being tested. Co-authored-by: Victor Stinner <vstinner@python.org> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| __main__.py | ||
| test_bufferedio.py | ||
| test_file.py | ||
| test_fileio.py | ||
| test_general.py | ||
| test_largefile.py | ||
| test_memoryio.py | ||
| test_univnewlines.py | ||