summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Issue #25940: Use internal local server more in test_sslMartin Panter2016-03-276-375/+378
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* Responsibility for argument checking belongs in set.__init__() rather than ↵Raymond Hettinger2016-03-261-3/+0
| | | | | | | 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.
* Minor code cleanup for PyArg_UnpackTuple.Raymond Hettinger2016-03-261-9/+8
|
* Issue #25911: more info on test_os failureVictor Stinner2016-03-261-1/+1
|
* makeopcodetargets.py: we need to import Lib/opcode.pyVictor Stinner2016-03-261-1/+21
| | | | | | | | | 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.
* Null merge 3.5Victor Stinner2016-03-250-0/+0
|\
| * _pickle: Fix load_counted_tuple(), use Py_ssize_t for sizeVictor Stinner2016-03-141-1/+1
| | | | | | | | Fix a warning on Windows 64-bit.
* | Fix test_os.test_symlink(): remove create symlinkVictor Stinner2016-03-251-0/+2
| |
* | mergeAlexander Belopolsky2016-03-253-1/+16
|\ \ | |/
| * Issue#26616:Fixed a bug in datetime.astimezone() method.Alexander Belopolsky2016-03-253-1/+16
| |
* | Backed out changeset 245a16f33c4bVictor Stinner2016-03-251-279/+202
| | | | | | | | Serhiy asked me to review it.
* | 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).
* | 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.
* | Modernize Python/makeopcodetargets.pyVictor Stinner2016-03-251-19/+11
| | | | | | | | | | | | | | | | | | * 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
* | 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.
* | Speed-up construction of empty sets by approx 12-14%.Raymond Hettinger2016-03-251-2/+3
| |
* | Null merge 3.5Victor Stinner2016-03-250-0/+0
|\ \ | |/ | | | | Changes were backported (transplated) from default to 3.5.
| * Issue #25654:Victor Stinner2016-03-255-19/+39
| | | | | | | | | | | | | | | | | | * 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.
| * Use Py_uintptr_t for atomic pointersVictor Stinner2016-01-223-30/+31
| | | | | | | | | | | | | | | | 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.
* | 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-255-19/+39
| | | | | | | | | | | | | | | | | | * 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.
* | remove duplicated check for fractions and complex numbers (closes #26076)Benjamin Peterson2016-03-251-4/+0
| | | | | | | | Patch by Oren Milman.
* | Fix a few typosZachary Ware2016-03-251-3/+3
| |
* | Don't doc check the venv dirZachary Ware2016-03-251-1/+1
| |
* | Merge 3.5 (pystate.h)Victor Stinner2016-03-251-2/+0
|\ \ | |/
| * pystate.h: fix _PyThreadState_UncheckedGet()Victor Stinner2016-03-241-2/+0
| | | | | | | | Declare the function even if thread support is disabled.
* | Fix bug in __import__ during Python shutdownVictor Stinner2016-03-243-441/+459
| | | | | | | | | | | | 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-243-11/+57
|\ \ | |/ | | | | | | | | 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-243-2/+29
| | | | | | | | | | | | 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.
* | Cleanup regrtest "main()" functionVictor Stinner2016-03-247-36/+38
| | | | | | | | | | | | | | * 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()
* | rt.bat: use -m test instead of Lib\test\regrtest.pyVictor Stinner2016-03-241-1/+1
| |
* | 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
| |