| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move many tests from NetworkedTests and NetworkedBIOTests to a new Simple-
BackgroundTests class, using the existing ThreadedEchoServer and SIGNED_
CERTFILE infrastructure.
For tests that cause the server to crash by rejecting its certificate,
separate them into independent test methods.
Added custom root certificate to capath with the following commands:
cp Lib/test/{pycacert.pem,capath/}
# Edit copy to remove part before certificate
c_rehash -v Lib/test/capath/
c_rehash -v -old Lib/test/capath/
# Note the generated file names
cp Lib/test/capath/{pycacert.pem,b1930218.0}
mv Lib/test/capath/{pycacert.pem,ceff1710.0}
Change to pure PEM version of SIGNING_CA because PEM_cert_to_DER_cert() does
not like the extra text at the start.
Moved test_connect_ex_error() into BasicSocketTests and rewrote it to connect
to a reserved localhost port.
NetworkedTests.test_get_server_certificate_ipv6() split out because it needs
to connect to an IPv6 DNS address.
The only reference left to self-signed.pythontest.net is test_timeout_
connect_ex(), which needs a remote server to reliably time out the
connection, but does not rely on the server running SSL.
Made ThreadedEchoServer call unwrap() by default when it sees the client has
shut the connection down, so that the client can cleanly call unwrap().
|
|
|
|
|
|
|
| |
set.__new__().
See dict.__new__() and list.__new__() for comparison. Neither of those examine or touch
args or kwds. That work is done in the __init__() methods.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Issue #20021: use importlib.machinery to import Lib/opcode.py and not an opcode
module coming from somewhere else. makeopcodetargets.py is part of the Python
build process and it is run by an external Python program, not the built Python
program.
Patch written by Serhiy Storchaka.
|
|\ |
|
| |
| |
| |
| | |
Fix a warning on Windows 64-bit.
|
| | |
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| | |
Serhiy asked me to review it.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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).
|
| | |
|
| | |
|
| |
| |
| |
| | |
Issue #26610.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Simply use "import opcode" to import the opcode module instead of tricks
using the imp module
* Use context manager for the output file
* Move code into a new main() function
* Replace assert with a regular if to check the number of arguments
* Import modules at top level
|
| |
| |
| |
| |
| | |
Replace also other open(filename, "w") with open(filename, "x") to fail if a
previous test forgot to remove filename.
|
| | |
|
|\ \
| |/
| |
| | |
Changes were backported (transplated) from default to 3.5.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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 #26161: Use Py_uintptr_t instead of void* for atomic pointers in
pyatomic.h. Use atomic_uintptr_t when <stdatomic.h> is used.
Using void* causes compilation warnings depending on which implementation of
atomic types is used.
|
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Patch by Oren Milman.
|
| | |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Declare the function even if thread support is disabled.
|
| |
| |
| |
| |
| |
| | |
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()
|
| | |
|
| | |
|