GeezerVison is showing github.com — Move test files into test subdirectories · Issue #108303 · python/cpython
Move test files into test subdirectories #108303DescriptionFeature 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 or coding20731.py.
When possible, I propose to move these files into sub-directories related to their test. Example:
- create
Lib/test/test_module/ sub-directory
- move
Lib/test/test_module.py to Lib/test/test_module/__init__.py
- move
good_getattr.py and bad_getattr*.py scripts to Lib/test/test_module/
Well, I created PR #108293 for this specific example.
Linked PRs
Reacted by Zachary Ware and Erlend E. Aasland Reacted by Zachary Ware Activityvstinner commented on Aug 22, 2023 Files (161):
Details
allsans.pem
ann_module2.py
ann_module3.py
ann_module4.py
ann_module5.py
ann_module6.py
ann_module7.py
ann_module8.py
ann_module.py
audiodata/
audiotests.py
audit-tests.py
autotest.py
badcert.pem
bad_coding2.py
bad_coding.py
badkey.pem
badsyntax_3131.py
badsyntax_future10.py
badsyntax_future3.py
badsyntax_future4.py
badsyntax_future5.py
badsyntax_future6.py
badsyntax_future7.py
badsyntax_future8.py
badsyntax_future9.py
badsyntax_pep3120.py
bisect_cmd.py*
capath/
cfgparser.1
cfgparser.2
cfgparser.3
cjkencodings/
clinic.test.c
cmath_testcases.txt
coding20731.py
crashers/
curses_tests.py*
data/
dataclass_module_1.py
dataclass_module_1_str.py
dataclass_module_2.py
dataclass_module_2_str.py
dataclass_textanno.py
datetimetester.py
decimaltestdata/
dis_module.py
double_const.py
dtracedata/
empty.vbs
encoded_modules/
exception_hierarchy.txt
ffdh3072.pem
final_a.py
final_b.py
floating_points.txt
fork_wait.py
formatfloat_testcases.txt
future_test1.py
future_test2.py
gdb_sample.py
idnsans.pem
ieee754.txt
imp_dummy.py
__init__.py
inspect_fodder2.py
inspect_fodder.py
inspect_stock_annotations.py
inspect_stringized_annotations_2.py
inspect_stringized_annotations.py
keycert2.pem
keycert3.pem
keycert4.pem
keycertecc.pem
keycert.passwd.pem
keycert.pem
leakers/
levenshtein_examples.json
libregrtest/
list_tests.py
lock_tests.py
__main__.py
make_ssl_certs.py
mapping_tests.py
math_testcases.txt
memory_watchdog.py
mime.types
mock_socket.py
mod_generics_cache.py
mp_fork_bomb.py
mp_preload.py
multibytecodec_support.py
nokia.pem
nosan.pem
nullbytecert.pem
nullcert.pem
pickletester.py
profilee.py
pstats.pck
pycacert.pem
__pycache__/
pycakey.pem
pyclbr_input.py
pydocfodder.py
pydoc_mod.py
pythoninfo.py
randv2_32.pck
randv2_64.pck
randv3.pck
recursion.tar
regrtest.py*
relimport.py
reperf.py
re_tests.py*
revocation.crl
sample_doctest.py
secp384r1.pem
selfsigned_pythontestdotnet.pem
seq_tests.py
setup_testcppext.py
setuptools-67.6.1-py3-none-any.whl
shadowed_super.py
signalinterproctester.py
smtpd.py*
sortperf.py
ssl_cert.pem
ssl_key.passwd.pem
ssl_key.pem
ssl_servers.py
ssltests.py
string_tests.py
subprocessdata/
support/
talos-2019-0758.pem
testcodec.py
_testcppext.cpp
test_difflib_expect.html
test_doctest2.txt
test_doctest3.txt
test_doctest4.txt
test_doctest.txt
testtar.tar
testtar.tar.xz
tf_inherit_check.py
time_hashlib.py
tkinterdata/
tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt
tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt
tokenize_tests.txt
tokenize_tests-utf8-coding-cookie-and-no-utf8-bom-sig.txt
tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt
tracedmodules/
_typed_dict_helper.py
typinganndata/
wheel-0.40.0-py3-none-any.whl
win_console_handler.py
xmltestdata/
xmltests.py
zip_cp437_header.zip
zipdir.zip
ziptestdata/
vstinner commented on Aug 22, 2023 The alternative is to have a "data" directory, so a different directory name:
- audiodata/
- decimaltestdata/
- dtracedata/
- subprocessdata/
- tkinterdata/
- typinganndata/
- xmltestdata/
- ziptestdata/
vstinner commented on Aug 22, 2023 Existing tests as a sub-directory (proposed solution):
- test_asyncio/
- test_capi/
- test_ctypes/
- test_email/
- test_import/
- test_importlib/
- test_json/
- test_lib2to3/
- test_module/
- test_peg_generator/
- test_sqlite3/
- test_tkinter/
- test_tomllib/
- test_tools/
- test_ttk/
- test_unittest/
- test_warnings/
- test_zipfile/
- test_zoneinfo/
terryjreedy commented on Aug 22, 2023 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. Reacted by Erlend E. Aasland vstinner commented on Aug 22, 2023 I created PR #108299 for test_crashers.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|