-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Move test files into test subdirectories #108303
Comments
In Python 2.7, the file was used by Lib/test/test_sgmllib.py to test Lib/sgmllib.py. The sgmllib module and its tests have been removed in Python 3.0.
Files (161):
|
The alternative is to have a "data" directory, so a different directory name:
|
Existing tests as a sub-directory (proposed solution):
|
I have also noticed and wondered about the melange of misc files. I like packaging the test code and data together in one directory, as in your 'module' example, especially given that we already have test_xyz directories. |
In Python 2.7, the file was used by Lib/test/test_sgmllib.py to test Lib/sgmllib.py. The sgmllib module and its tests have been removed in Python 3.0.
* Move test_cppext to its own directory * Rename setup_testcppext.py to setup.py * Rename _testcppext.cpp to extension.cpp * The source (extension.cpp) is now also copied by the test.
I created PR #108299 for test_crashers. |
* Move test_cppext to its own directory * Rename setup_testcppext.py to setup.py * Rename _testcppext.cpp to extension.cpp * The source (extension.cpp) is now also copied by the test.
…8325) * Move test_cppext to its own directory * Rename setup_testcppext.py to setup.py * Rename _testcppext.cpp to extension.cpp * The source (extension.cpp) is now also copied by the test. (cherry picked from commit 21dda09) Co-authored-by: Victor Stinner <[email protected]>
* Move test_cppext to its own directory * Rename setup_testcppext.py to setup.py * Rename _testcppext.cpp to extension.cpp * The source (extension.cpp) is now also copied by the test. (cherry picked from commit 21dda09)
…#108328) gh-108303: Add Lib/test/test_cppext/ sub-directory (GH-108325) * Move test_cppext to its own directory * Rename setup_testcppext.py to setup.py * Rename _testcppext.cpp to extension.cpp * The source (extension.cpp) is now also copied by the test. (cherry picked from commit 21dda09) Co-authored-by: Victor Stinner <[email protected]>
What with data files used in several different tests? |
For this case, I suggest to keep the current trend of having a "data/" directory, such as The problem with these "data" directories is that when a test file is no longer needed, it's more likely to be forgotten. |
Move test_dataclasses.py and its "dataclass_*.py" modules into the new Lib/test/test_dataclasses/ subdirectory.
Move test_doctest.py and test_doctest2.py the following files to a new Lib/test/test_dataclasses/ directory. Move also data files: * doctest*.py * sample_doctest*.py * test_doctest*.txt Replace test with test.test_doctest in Lib/test/test_doctest/test_doctest.py.
Move test_dataclasses.py and its "dataclass_*.py" modules into the new Lib/test/test_dataclasses/ subdirectory.
I close the issue. While it's not 100% done, remaining files can reuse this closed issue, or another issue can be created. This issue already has a long list of pull requests and a long history. Thanks to everybody who helped cleaning Lib/test/, reviewers, and especially @sobolevn who wrote many changes! |
…onGH-114687) (cherry picked from commit f9154f8) Co-authored-by: Nikita Sobolev <[email protected]>
…onGH-114687) (cherry picked from commit f9154f8) Co-authored-by: Nikita Sobolev <[email protected]>
…anndata` (python#111825) Co-authored-by: Alex Waygood <[email protected]>
…t/test_doctest/` (python#112109) Co-authored-by: Brett Cannon <[email protected]>
Update test_logging.py and test_smtplib.py.
Move code into Lib/test/test_super.py.
Feature or enhancement
Proposal:
The Python test suite has around 166 files and sub-directories where the name is not clearly associated to a test. For example, it's not obvious to me which test uses
talos-2019-0758.pem
orcoding20731.py
.When possible, I propose to move these files into sub-directories related to their test. Example:
Lib/test/test_module/
sub-directoryLib/test/test_module.py
toLib/test/test_module/__init__.py
good_getattr.py
andbad_getattr*.py
scripts toLib/test/test_module/
Well, I created PR #108293 for this specific example.
Linked PRs
ann_module*.py
files totypinganndata/
folder #108354Lib/test/tokenizedata
#109265Lib/test/tokenizedata
toTESTSUBDIRS
#109314test_future
into its own subdir #109368Lib/test/certdata/
#109489Lib/test/mathdata/
#109512badsyntax_pep3120.py
#109513test_inspect/
#109607ann_module*.py
files totypinganndata/
folder (GH-108354) #109672ann_module*.py
files totypinganndata/
folder (#108354) #109673test_future
into its own test_future_stmt subdir (#109368) #109679test_future
into its own test_future_stmt subdir (#109368) #109680Lib/test/certdata/
(GH-109489) #109682Lib/test/certdata/
(GH-109489) #109683badsyntax_pep3120.py
(GH-109513) #109724Lib/test/certdata/
(GH-109489) (GH-109682) #110646test_inspect/
(GH-109607) #110732test_inspect/
(GH-109607) #111543zip
andtar
archives toLib/test/archivetestdata
#111549typing
related files toLib/test/typinganndata
#111825Lib/test/configparserdata/
#111879Lib/test/test_module
#111880Lib/test/configparserdata/
(gh-111879) #111882Lib/test/configparserdata/
(gh-111879) #111883Lib/test/test_module
(GH-111880) #111891Lib/test/test_module
(GH-111880) #111892Lib/test/configdata
#111899Lib/test/configdata
(GH-111899) #111945Lib/test/configdata
(GH-111899) #111946double_const
totest_import
where it belongs #112108Lib/test/test_doctest/
#112109imp_dummy
test file #112110imp_dummy
test file (GH-112110) #112114double_const
totest_import
where it belongs (GH-112108) #112976double_const
totest_import
where it belongs (GH-112108) #112977Lib/test/test_doctest/
(GH-112109) #114254Lib/test/test_doctest/
(GH-112109) #114313.whl
test files toLib/test/whldata/
#114343test_xml
#114344Lib/test/reperf.py
#114356smtpd
totest.support
#114368Lib/test/shadowed_super.py
#114372smtpd
totest.support
(GH-114368) #114427Lib/test/shadowed_super.py
(GH-114372) #114433.whl
test files toLib/test/wheeldata/
(GH-114343) #114488pydoc
related files totest_pydoc
#114506Lib/test/sortperf.py
toTools/scripts
#114687pydoc
related files totest_pydoc
(GH-114506) #115501pydoc
related files totest_pydoc
(GH-114506) #115502Lib/test/sortperf.py
toTools/scripts
(GH-114687) #115625Lib/test/sortperf.py
toTools/scripts
(GH-114687) #115626The text was updated successfully, but these errors were encountered: