summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* Rework libregrtest.save_envVictor Stinner2016-03-251-202/+279
| | | | | | | | | | | * 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
* changeset: 100749:0b61b2d28a07Victor Stinner2016-03-251-1/+10
| | | | | | | | | | | | 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.
* Merge 3.5Victor Stinner2016-03-251-2/+3
|\
| * doctest: fix _module_relative_path() error messageVictor Stinner2016-03-251-2/+3
| | | | | | | | | | Write the module name rather than <module> in the error message, if module has no __file__ attribute (ex: package).
| * Issue #25654:Victor Stinner2016-03-254-18/+38
| | | | | | | | | | | | | | | | | | * 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.
| * Issue #21925: Fix test_warnings for release modeVictor Stinner2016-03-251-2/+2
| | | | | | | | Use -Wd comment line option to log the ResourceWarning.
* | test_doctest: remove unused importsVictor Stinner2016-03-251-2/+1
| |
* | test_venv: enhance test_devnull()Victor Stinner2016-03-251-10/+9
| |
* | Skip test_venv.test_with_pip() if ctypes missVictor Stinner2016-03-251-0/+7
| | | | | | | | Issue #26610.
* | test_os: Win32ErrorTests now ensures that TESTFN doesn't existVictor Stinner2016-03-251-6/+8
| | | | | | | | | | Replace also other open(filename, "w") with open(filename, "x") to fail if a previous test forgot to remove filename.
* | Issue #21925: Fix test_warnings for release modeVictor Stinner2016-03-251-2/+2
| | | | | | | | Use -Wd comment line option to log the ResourceWarning.
* | Issue #25654:Victor Stinner2016-03-254-18/+38
| | | | | | | | | | | | | | | | | | * 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.
* | test_io: ignore DeprecationWarning on bytes path on WindowsVictor Stinner2016-03-251-1/+5
| |
* | Issue #26637: Fix test_ioVictor Stinner2016-03-251-2/+1
| | | | | | | | | | The import machinery now raises a different exception when it fails at Python shutdown.
* | Fix bug in __import__ during Python shutdownVictor Stinner2016-03-241-2/+9
| | | | | | | | | | | | 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).
* | Merge 3.5Victor Stinner2016-03-242-11/+52
|\ \ | |/ | | | | | | | | 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.
| * warnings.formatwarning(): catch exceptionsVictor Stinner2016-03-242-2/+25
| | | | | | | | | | | | Issue #21925: warnings.formatwarning() now catches exceptions on linecache.getline(...) to be able to log ResourceWarning emitted late during the Python shutdown process.
| * Fix test_warnings.test_improper_option()Victor Stinner2016-03-241-6/+9
| | | | | | | | | | test_warnings: only run test_improper_option() and test_warnings_bootstrap() once. The unit test doesn't depend on self.module.
| * Issue #26621: Remove unnecessary test.Stefan Krah2016-03-231-1/+0
| |
* | Cleanup regrtest "main()" functionVictor Stinner2016-03-246-34/+36
| | | | | | | | | | | | | | * 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()
* | Cleanup regrtest.pyVictor Stinner2016-03-241-5/+16
| | | | | | | | | | | | * Move code into a new _main() function * Fix loop to cleanup sys.path * Remove unused import
* | support.temp_dir(): call support.rmtree() instead of shutil.rmtree()Victor Stinner2016-03-241-1/+1
| |
* | test_os: use support.rmtree() to cleanup WalkTestsVictor Stinner2016-03-241-29/+1
| |
* | Enhance and modernize test_osVictor Stinner2016-03-241-77/+76
| | | | | | | | | | | | | | | | | | * 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
* | test_os: use @support.requires_linux_versionVictor Stinner2016-03-241-5/+4
| |
* | Closes #26620: Fix ResourceWarning in test_urllib2_localnetVictor Stinner2016-03-241-21/+18
| | | | | | | | | | | | * 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
* | Enhance and modernize test_genericpathVictor Stinner2016-03-241-136/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Enhance os._DummyDirEntryVictor Stinner2016-03-241-2/+23
| | | | | | | | | | | | | | | | | | 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()
* | regrtest: when parallel tests are interrupted, display progressVictor Stinner2016-03-241-6/+18
| |
* | regrtest: mention in tests run sequentially or in parallelVictor Stinner2016-03-242-0/+4
| |
* | regrtest: fix --fromfile featureVictor Stinner2016-03-242-6/+41
| | | | | | | | | | * Update code for the name regrtest output format. * Enhance also test_regrtest test on --fromfile
* | Fix DeprecationWarning on WindowsVictor Stinner2016-03-241-49/+67
| | | | | | | | | | Issue #25911: Use support.check_warnings() to expect or ignore DeprecationWarning in test_os.
* | Fix test_spwd on OpenIndianaVictor Stinner2016-03-231-3/+8
| | | | | | | | Issue #18787: restore "bin" name in test_spwd but catch KeyError.
* | Try to fix test_gdb on s390x SLES 3.xVictor Stinner2016-03-231-0/+2
| | | | | | | | Ignore empty lines in stderr.
* | Issue #26621: Update libmpdec version and remove unnecessary test case.Stefan Krah2016-03-232-2/+1
| |
* | Try to fix test_spwd on OpenIndianaVictor Stinner2016-03-231-1/+1
| | | | | | | | | | Issue #18787: try to get the "root" entry which should exist on all UNIX instead of "bin" which doesn't exist on OpenIndiana.
* | Try to fix test_gdb on s390x buildbotsVictor Stinner2016-03-231-17/+5
| |
* | faulthandler: only log fatal exceptionsVictor Stinner2016-03-231-1/+1
| | | | | | | | | | | | | | | | 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"
* | regrtest: display test duration in sequential modeVictor Stinner2016-03-234-9/+29
| | | | | | | | Only display duration if a test takes more than 30 seconds.
* | faulthandler: add Windows exception handlerVictor Stinner2016-03-231-13/+49
| | | | | | | | | | | | 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).
* | regrtest: add timeout to main process when using -jNVictor Stinner2016-03-231-2/+11
| | | | | | | | | | libregrtest: add a watchdog to run_tests_multiprocess() using faulthandler.dump_traceback_later().
* | Add a source parameter to warnings.warn()Victor Stinner2016-03-2211-13/+21
| | | | | | | | | | | | | | | | 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
* | Issue #26588: remove debug traces from _tracemalloc.Victor Stinner2016-03-222-11/+0
| |
* | Issue #26588: skip test_warnings.test_tracemalloc()Victor Stinner2016-03-221-0/+1
| |
* | Issue #26588: add debug tracesVictor Stinner2016-03-221-0/+10
| | | | | | | | Try to debug random failure on buildbots.
* | regrtest: add time to outputVictor Stinner2016-03-222-6/+19
| | | | | | | | | | Timestamps should help to debug slow buildbots, and timeout and hang on buildbots.
* | Add C functions _PyTraceMalloc_Track()Victor Stinner2016-03-221-0/+115
| | | | | | | | | | | | | | | | 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.
* | tracemalloc now supports domainsVictor Stinner2016-03-222-45/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix test_ssl.test_refcycle()Victor Stinner2016-03-211-1/+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.
* | Issue #26581: Use the first coding cookie on a line, not the last one.Serhiy Storchaka2016-03-205-5/+5
|\ \ | |/