| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
* Replace get/restore methods with a Resource class and Resource subclasses
* Create ModuleAttr, ModuleAttrList and ModuleAttrDict helper classes
* Use __subclasses__() to get resource classes instead of using an hardcoded
list (2 shutil resources were missinged in the list!)
* Don't define MultiprocessingProcessDangling resource if the multiprocessing
module is missing
* Nicer diff for dictionaries. Useful for the big os.environ dict
* Reorder code to group resources
|
|
|
|
|
|
|
|
|
|
|
|
| |
tag: tip
parent: 100742:ebae81b31cf6
user: Victor Stinner <victor.stinner@gmail.com>
date: Fri Mar 25 15:03:34 2016 +0100
files: Lib/test/test_os.py
description:
test_os: Win32ErrorTests checks if file exists
Don't use os.path.exists() since it ignores *any* OSError.
|
|\ |
|
| |
| |
| |
| |
| | |
Write the module name rather than <module> in the error message, if module has
no __file__ attribute (ex: package).
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* multiprocessing: open file with closefd=False to avoid ResourceWarning
* _test_multiprocessing: open file with O_EXCL to detect bugs in tests (if a
previous test forgot to remove TESTFN)
* test_sys_exit(): remove TESTFN after each loop iteration
Initial patch written by Serhiy Storchaka.
|
| |
| |
| |
| | |
Use -Wd comment line option to log the ResourceWarning.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Issue #26610.
|
| |
| |
| |
| |
| | |
Replace also other open(filename, "w") with open(filename, "x") to fail if a
previous test forgot to remove filename.
|
| |
| |
| |
| | |
Use -Wd comment line option to log the ResourceWarning.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* multiprocessing: open file with closefd=False to avoid ResourceWarning
* _test_multiprocessing: open file with O_EXCL to detect bugs in tests (if a
previous test forgot to remove TESTFN)
* test_sys_exit(): remove TESTFN after each loop iteration
Initial patch written by Serhiy Storchaka.
|
| | |
|
| |
| |
| |
| |
| | |
The import machinery now raises a different exception when it fails at Python
shutdown.
|
| |
| |
| |
| |
| |
| | |
Issue #26637: The importlib module now emits an ImportError rather than a
TypeError if __import__() is tried during the Python shutdown process but
sys.path is already cleared (set to None).
|
|\ \
| |/
| |
| |
| |
| | |
Issue #21925: warnings.formatwarning() now catches exceptions when calling
linecache.getline() and tracemalloc.get_object_traceback() to be able to log
ResourceWarning emitted late during the Python shutdown process.
|
| |
| |
| |
| |
| |
| | |
Issue #21925: warnings.formatwarning() now catches exceptions on
linecache.getline(...) to be able to log ResourceWarning emitted late during
the Python shutdown process.
|
| |
| |
| |
| |
| | |
test_warnings: only run test_improper_option() and test_warnings_bootstrap()
once. The unit test doesn't depend on self.module.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
* Rename libregrtest.main_in_temp_cwd() to libregrtest.main()
* Add regrtest.main_in_temp_cwd() alias to libregrtest.main()
* Move old main_in_temp_cwd() code into libregrtest.Regrtest.main()
* Update multiple scripts to call libregrtest.main()
|
| |
| |
| |
| |
| |
| | |
* Move code into a new _main() function
* Fix loop to cleanup sys.path
* Remove unused import
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* add create_file() helper function
* create files using "x" mode instead of "w" to detect when a previous test
forget to remove a file
* open file for writing in unbuferred mode (buffering=0)
* replace "try/finally: unlink" with self.addCleanup(support.unlink)
* register unlink cleanup function *before* creating new files
|
| | |
|
| |
| |
| |
| |
| |
| | |
* Use context manager on urllib objects to ensure that they are closed on error
* Use self.addCleanup() to cleanup resources even if a test is interrupted
with CTRL+c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Replace "try/finally: os.remove()" with self.addCleanup(support.unlink) or
self.addCleanup(support.rmdir): the support function handles the case when
the file doesn't exist
* Replace "try/finally: f.close()" with "with open(...) as f:"
* test_getsize: add a second test with a different size
* Create file using "x" mode to ensure that the file didn't exist before, to
detect bugs in tests
* Open files in unbuffered mode (buferring=0) to write immediatly data on disk
* Replace map() with simpler code
* Split isdir() unit test into two units tests to make them less dependant,
same change for isfile() test
* test_samefile(): test also two different files
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Issue #25911:
* Try to fix test_os.BytesWalkTests on Windows
* Try to mimick better the reference os.DirEntry on Windows
* _DummyDirEntry now caches os.stat() result
* _DummyDirEntry constructor now tries to get os.stat()
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
* Update code for the name regrtest output format.
* Enhance also test_regrtest test on --fromfile
|
| |
| |
| |
| |
| | |
Issue #25911: Use support.check_warnings() to expect or ignore
DeprecationWarning in test_os.
|
| |
| |
| |
| | |
Issue #18787: restore "bin" name in test_spwd but catch KeyError.
|
| |
| |
| |
| | |
Ignore empty lines in stderr.
|
| | |
|
| |
| |
| |
| |
| | |
Issue #18787: try to get the "root" entry which should exist on all UNIX
instead of "bin" which doesn't exist on OpenIndiana.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Issue #23848, #26622:
* faulthandler now only logs fatal Windows exceptions.
* write error code as decimal, not as hexadecimal
* replace "Windows exception" with "Windows fatal exception"
|
| |
| |
| |
| | |
Only display duration if a test takes more than 30 seconds.
|
| |
| |
| |
| |
| |
| | |
Issue #23848: On Windows, faulthandler.enable() now also installs an exception
handler to dump the traceback of all Python threads on any Windows exception,
not only on UNIX signals (SIGSEGV, SIGFPE, SIGABRT).
|
| |
| |
| |
| |
| | |
libregrtest: add a watchdog to run_tests_multiprocess() using
faulthandler.dump_traceback_later().
|
| |
| |
| |
| |
| |
| |
| |
| | |
Issue #26604:
* Add a new optional source parameter to _warnings.warn() and warnings.warn()
* Modify asyncore, asyncio and _pyio modules to set the source parameter when
logging a ResourceWarning warning
|
| | |
|
| | |
|
| |
| |
| |
| | |
Try to debug random failure on buildbots.
|
| |
| |
| |
| |
| | |
Timestamps should help to debug slow buildbots, and timeout and hang on
buildbots.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Issue #26530:
* Add C functions _PyTraceMalloc_Track() and _PyTraceMalloc_Untrack() to track
memory blocks using the tracemalloc module.
* Add _PyTraceMalloc_GetTraceback() to get the traceback of an object.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Issue #26588:
* The _tracemalloc now supports tracing memory allocations of multiple address
spaces (domains).
* Add domain parameter to tracemalloc_add_trace() and
tracemalloc_remove_trace().
* tracemalloc_add_trace() now starts by removing the previous trace, if any.
* _tracemalloc._get_traces() now returns a list of (domain, size,
traceback_frames): the domain is new.
* Add tracemalloc.DomainFilter
* tracemalloc.Filter: add an optional domain parameter to the constructor and a
domain attribute
* Sublte change: use Py_uintptr_t rather than void* in the traces key.
* Add tracemalloc_config.use_domain, currently hardcoded to 1
|
| |
| |
| |
| |
| |
| | |
Issue #26590: support.check_warnings() stores warnins, but ResourceWarning now
comes with a reference to the socket object which indirectly keeps the socket
alive.
|
|\ \
| |/ |
|