summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tools
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-108303: Move tokenize-related data to Lib/test/tokenizedata ↵Victor Stinner2023-10-021-1/+1
| | | | | | | | | | | | | | | (GH-109265) (#109677) * gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265) (cherry picked from commit 1110c5bc828218086f6397ec05a9312fb73ea30a) * gh-108303: Add `Lib/test/tokenizedata` to `TESTSUBDIRS` (#109314) (cherry picked from commit 42ab2cbd7b5e76e919b70883ae683e789dbd913d) --------- Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-103053: Skip test_freeze_simple_script() on PGO build (#109591) ↵Victor Stinner2023-10-021-0/+4
| | | | | | | | | | | | | | | | (#109614) gh-103053: Skip test_freeze_simple_script() on PGO build (#109591) Skip test_freeze_simple_script() of test_tools.test_freeze if Python is built with "./configure --enable-optimizations", which means with Profile Guided Optimization (PGO): it just makes the test too slow. The freeze tool is tested by many other CIs with other (faster) compiler flags. test.pythoninfo now gets also get_build_info() of test.libregrtests.utils. (cherry picked from commit 81cd1bd713624c3d26b647f3d28f2fd905887a0d)
* [3.12] gh-108416: Mark slow test methods with @requires_resource('cpu') ↵Miss Islington (bot)2023-09-021-0/+1
| | | | | | | | | | | | (GH-108421) (#108798) gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421) Only mark tests which spend significant system or user time, by itself or in subprocesses. (cherry picked from commit f3ba0a74cd50274acdcd592d4ce8395b92492b7c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Remove non-existing tools from Sundry skiplist (#103991)Oleg Iarygin2023-04-291-9/+2
|
* gh-102515: Remove unused imports in the `Lib/` directory (#102516)Alex Waygood2023-03-081-1/+0
|
* gh-95731: Fix module docstring extraction in pygettext (#95732)Jakub Kuczys2022-10-151-0/+20
|
* gh-97669: Fix test_tools reference leak (#98216)Victor Stinner2022-10-121-1/+5
| | | | | | | | test_tools.test_sundry() now uses an unittest mock to prevent the logging module to register a real "atfork" function which kept the logging module dictionary alive. So the logging module can be properly unloaded. Previously, the logging module was loaded before test_sundry(), but it's no longer the case since recent test_tools sub-tests removals.
* gh-97669: Create Tools/patchcheck/ directory (#98186)Victor Stinner2022-10-121-2/+2
| | | | Move patchcheck.py, reindent.py and untabify.py scripts to a new Tools/patchcheck/ directory.
* gh-97669: Remove outdated example scripts (#97675) (#98167)Victor Stinner2022-10-114-253/+2
| | | | | | | | | | | Remove outdated example scripts of the Tools/scripts/ directory: * gprof2html.py * md5sum.py * nm2def.py * pathfix.py * win_add2path.py Remove test_gprof2html, test_md5sum and test_pathfix of test_tools.
* gh-97670: Remove sys.getdxp() and analyze_dxp.py script (#97671)Victor Stinner2022-10-041-8/+1
| | | | | | | Remove the sys.getdxp() function and the Tools/scripts/analyze_dxp.py script. DXP stands for "dynamic execution pairs". They were related to DYNAMIC_EXECUTION_PROFILE and DXPAIRS macros which have been removed in Python 3.11. Python can now be built with "./configure --enable-pystats" to gather statistics on Python opcodes.
* gh-97669: Remove outdated example scripts (#97675)Victor Stinner2022-10-044-506/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove outdated example scripts of the Tools/scripts/ directory. A copy can be found in the old-demos project: https://github.com/gvanrossum/old-demos Removed scripts (39): * byext.py * byteyears.py * cleanfuture.py * copytime.py * crlf.py * db2pickle.py * dutree.doc * dutree.py * find-uname.py * find_recursionlimit.py * finddiv.py * findlinksto.py * findnocoding.py * fixcid.py * fixdiv.py * fixheader.py * fixnotice.py * fixps.py * get-remote-certificate.py * google.py * highlight.py * ifdef.py * import_diagnostics.py * lfcr.py * linktree.py * lll.py * mailerdaemon.py * make_ctype.py * mkreal.py * objgraph.py * pdeps.py * pickle2db.py * pindent.py * pysource.py * reindent-rst.py * rgrep.py * suff.py * texi2html.py * which.py Changes: * Remove test_fixcid, test_lll, test_pdeps and test_pindent of test.test_tools. * Remove get-remote-certificate.py changelog entry, since the script was removed. Note: there is a copy of crlf.py in Lib/test/test_lib2to3/data/.
* gh-84623: Remove unused imports in tests (#93772)Victor Stinner2022-06-133-3/+0
|
* GH-91752: Skip test_freeze_simple_script when zlib is not available (#91758)Abhigyan Bose2022-05-031-1/+1
| | | Fixes GH-91752.
* bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)Christian Heimes2022-03-221-0/+4
| | | | | | | | | | | - Add requires_fork and requires_subprocess to more tests - Skip extension import tests if dlopen is not available - Don't assume that _testcapi is a shared extension - Skip a lot of socket tests that don't work on Emscripten - Skip mmap tests, mmap emulation is incomplete - venv does not work yet - Cannot get libc from executable The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).
* bpo-46633: Skip tests on ASAN and/or MSAN builds (GH-31632)Victor Stinner2022-03-011-0/+7
| | | | | | | | | | | | Skip tests on ASAN and/or MSAN builds: * multiprocessing tests * test___all__ * test_concurrent_futures * test_decimal * test_peg_generator * test_tools The ASAN job of GitHub Actions no longer excludes these tests.
* bpo-46425: Fix direct invocation of multiple test modules (GH-30666)Nikita Sobolev2022-01-181-1/+1
|
* bpo-40479: Fix hashlib's usedforsecurity for OpenSSL 3.0.0 (GH-30455)Christian Heimes2022-01-131-1/+1
|
* bpo-45783: Preserve file moves and deletions in the tests for the freeze ↵Eric Snow2021-11-231-4/+5
| | | | | | tool. (GH-29527) Use shutil.copytree rather than Git, which might be missing (or configured differently) when testing Python built from a source release.
* bpo-45629: Add a test for the "freeze" tool. (gh-29222)Eric Snow2021-10-281-0/+29
| | | | | | | The "freeze" tool has been part of the repo for a long time. However, it hasn't had any tests in the test suite to guard against regressions. We add such a test here. This is especially important as there has been a lot of change recently related to frozen modules, with more to come. Note that as part of the test we build Python out-of-tree and install it in a temp dir. https://bugs.python.org/issue45629
* Fix EncodingWarning in test_tools. (GH-28846)Inada Naoki2021-10-106-23/+27
|
* bpo-45042: Now test classes decorated with `requires_hashdigest` are not ↵Nikita Sobolev2021-09-041-3/+4
| | | | | | skipped (GH-28060) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-36310: Allow pygettext.py to detect calls to gettext in f-strings. ↵jack11422020-11-091-0/+70
| | | | | | | (GH-19875) Adds support to Tools/i18n/pygettext.py for gettext calls in f-strings. This process is done by parsing the f-strings, processing each value, and flagging the ones which contain a gettext call. Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
* bpo-36876: Fix the C analyzer tool. (GH-22841)Eric Snow2020-10-2320-4314/+0
| | | | | | | The original tool wasn't working right and it was simpler to create a new one, partially re-using some of the old code. At this point the tool runs properly on the master. (Try: ./python Tools/c-analyzer/c-analyzer.py analyze.) It take ~40 seconds on my machine to analyze the full CPython code base. Note that we'll need to iron out some OS-specific stuff (e.g. preprocessor). We're okay though since this tool isn't used yet in our workflow. We will also need to verify the analysis results in detail before activating the check in CI, though I'm pretty sure it's close. https://bugs.python.org/issue36876
* bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)Victor Stinner2020-08-111-5/+5
| | | Automerge-Triggered-By: @tiran
* bpo-40275: Use new test.support helper submodules in tests (GH-21743)Hai Shi2020-08-061-4/+4
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21727)Hai Shi2020-08-046-17/+21
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21151)Hai Shi2020-06-251-2/+3
| | | | | | | | | | | | | Use new test.support helper submodules in tests: * distutils tests * test_buffer * test_compile * test_filecmp * test_fileinput * test_readline * test_smtpnet * test_structmembers * test_tools
* bpo-41069: Make TESTFN and the CWD for tests containing non-ascii ↵Serhiy Storchaka2020-06-251-3/+5
| | | | characters. (GH-21035)
* bpo-9216: hashlib usedforsecurity fixes (GH-20258)Christian Heimes2020-05-221-0/+2
| | | | | | | | | func:`hashlib.new` passed ``usedforsecurity`` to OpenSSL EVP constructor ``_hashlib.new()``. test_hashlib and test_smtplib handle strict security policy better. Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: @tiran
* bpo-40443: Remove unused imports in tests (GH-19805)Victor Stinner2020-04-293-3/+1
|
* bpo-38870: Expose a function to unparse an ast object in the ast module ↵Pablo Galindo2019-11-241-318/+0
| | | | | | | (GH-17302) Add ast.unparse() as a function in the ast module that can be used to unparse an ast.AST object and produce a string with code that would produce an equivalent ast.AST object when parsed.
* bpo-36876: Re-organize the c-analyzer tool code. (gh-16841)Eric Snow2019-10-1919-471/+344
| | | | | This is partly a cleanup of the code. It also is preparation for getting the variables from the source (cross-platform) rather than from the symbols. The change only touches the tool (and its tests).
* bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)Ruediger Pluem2019-10-111-6/+28
| | | pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively.
* bpo-38187: Fix a refleak in Tools/c-analyzer. (gh-16304)Eric Snow2019-09-277-40/+100
| | | | | The "Slot" helper (descriptor) is leaking references due to its caching mechanism. The change includes a partial fix to Slot, but also adds Variable.storage to replace the problematic use of Slot. https://bugs.python.org/issue38187
* bpo-37064: Add option -a to pathfix.py tool (GH-15717)PatrikKopkan2019-09-251-17/+56
| | | Add option -a to Tools/Scripts/pathfix.py script: add flags.
* bpo-38187: Fix reference leak in test_tools (GH-16233)Pablo Galindo2019-09-171-0/+3
|
* bpo-36876: Add a tool that identifies unsupported global C variables. (#15877)Eric Snow2019-09-1120-9/+4401
|
* bpo-37064: Skip test_tools.test_pathfix if installed (GH-15705)Victor Stinner2019-09-051-1/+5
| | | | If Python is installed, skip test_tools.test_pathfix test because Tools/scripts/pathfix.py script is not installed.
* bpo-37064: Add option -k to Tools/scripts/pathfix.py (GH-15548)PatrikKopkan2019-09-051-0/+64
| | | Add flag -k to pathscript.py script: preserve shebang flags.
* bpo-37834: Normalise handling of reparse points on Windows (GH-15231)Steve Dower2019-08-211-2/+4
| | | | | | | | | | bpo-37834: Normalise handling of reparse points on Windows * ntpath.realpath() and nt.stat() will traverse all supported reparse points (previously was mixed) * nt.lstat() will let the OS traverse reparse points that are not name surrogates (previously would not traverse any reparse point) * nt.[l]stat() will only set S_IFLNK for symlinks (previous behaviour) * nt.readlink() will read destinations for symlinks and junction points only bpo-1311: os.path.exists('nul') now returns True on Windows * nt.stat('nul').st_mode is now S_IFCHR (previously was an error)
* bpo-37704: Remove Tools/scripts/h2py.py (GH-15000)Victor Stinner2019-07-301-1/+1
| | | Use cffi to access a C API in Python.
* bpo-37053: handle strings like u"bar" correctly in Tools/parser/unparse.py ↵Chih-Hsuan Yen2019-05-261-0/+5
| | | | | | | | | | | | (GH-13583) Constant.kind is added in https://bugs.python.org/issue36280. Current possible values for Constant.kind are "u" or None. For r'bar' and b'bar', Constant.kind value is None, so there's no need for special handling. https://bugs.python.org/issue37053
* bpo-36766: Typos in docs and code comments (GH-13116)penguindustin2019-05-061-1/+1
|
* bpo-36776: Add @support.skip_unless_symlink to test_lll.py (GH-13058)Zackery Spytz2019-05-021-0/+1
|
* bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026)Zackery Spytz2019-05-021-0/+38
|
* bpo-25094: Fix test_tools.test_sundry() on Windows (GH-8406)Victor Stinner2018-07-231-4/+14
| | | | | | | | | | When Python is installed on Windows, python -m test test_tools failed because it tried to run Tools\scripts\2to3.py which requires an argument. Skip this script. On other platforms or on Windows but when run from source code (not installed), the script is called "2to3" instead of "2to.py" and so was already skipped. Modify also the unit test to unload all modules which have been loaded by the test.
* bpo-33189: pygettext.py now accepts only literal strings (GH-6364)Serhiy Storchaka2018-04-191-6/+65
| | | | as docstrings and translatable strings, and rejects bytes literals and f-string expressions.
* bpo-31920: Fixed handling directories as arguments in the ``pygettext`` ↵Serhiy Storchaka2018-04-091-1/+25
| | | | | script. (GH-6259) Based on patch by Oleg Krasnikov.
* bpo-32222: Fix pygettext skipping docstrings for funcs with arg typehints ↵Tobotimus2018-02-261-0/+88
| | | | (GH-4745)
* bpo-31174: Improve the code of test_tools.test_unparse. (#4146)Serhiy Storchaka2017-10-271-8/+8
|