summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/test_runner.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-93839: Move Lib/unttest/test/ to Lib/test/test_unittest/ (#94043)Victor Stinner2022-06-211-1330/+0
| | | | | | | | * Move Lib/unittest/test/ to Lib/test/test_unittest/ * Remove Lib/test/test_unittest.py * Replace unittest.test with test.test_unittest * Remove unittest.load_tests() * Rewrite unittest __init__.py and __main__.py * Update build system, CODEOWNERS, and wasm_assets.py
* bpo-45046: Support context managers in unittest (GH-28045)Serhiy Storchaka2022-05-081-0/+110
| | | | | | Add methods enterContext() and enterClassContext() in TestCase. Add method enterAsyncContext() in IsolatedAsyncioTestCase. Add function enterModuleContext().
* bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)Christian Heimes2022-03-221-0/+2
| | | | | | | | | | | - 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-45162: Revert "Remove many old deprecated unittest features" (GH-30935)Gregory P. Smith2022-01-271-3/+7
| | | | | | | | | | Revert "bpo-45162: Remove many old deprecated unittest features (GH-28268)" This reverts commit b0a6ede3d0bd6fa4ffe413ab4dfc1059201df25b. We're deferring this change until 3.12 while upstream projects that use the legacy assertion method names are fixed. See the issue for links to the discussion. Many upstream projects now have issues and PRs filed.
* bpo-30856: Update TestResult early, without buffering in _Outcome (GH-28180)Serhiy Storchaka2021-09-191-5/+9
| | | | | | | TestResult methods addFailure(), addError(), addSkip() and addSubTest() are now called immediately after raising an exception in test or finishing a subtest. Previously they were called only after finishing the test clean up.
* bpo-45162: Remove many old deprecated unittest features (GH-28268)Serhiy Storchaka2021-09-171-7/+3
| | | | | | | * "fail*" and "assert*" aliases of TestCase methods. * Broken from start TestCase method assertDictContainsSubset(). * Ignored TestLoader.loadTestsFromModule() parameter use_load_tests. * Old alias _TextTestResult of TextTestResult.
* bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006)Serhiy Storchaka2021-08-301-4/+205
| | | | | | | | | | | | | | * Functions registered with addModuleCleanup() were not called unless the user defines tearDownModule() in their test module. * Functions registered with addClassCleanup() were not called if tearDownClass is set to None. * Buffering in TestResult did not work with functions registered with addClassCleanup() and addModuleCleanup(). * Errors in functions registered with addClassCleanup() and addModuleCleanup() were not handled correctly in buffered and debug modes. * Errors in setUpModule() and functions registered with addModuleCleanup() were reported in wrong order. * And several lesser bugs.
* [3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620)Serhiy Storchaka2019-06-051-3/+2
| | | Turn deprecation warnings added in 3.8 into TypeError.
* bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700)Serhiy Storchaka2019-06-011-3/+2
|
* bpo-36492: Deprecate passing some arguments as keyword arguments. (GH-12637)Serhiy Storchaka2019-04-011-0/+60
| | | | | | | | | | | | | | | | | | | | | | Deprecated passing the following arguments as keyword arguments: - "func" in functools.partialmethod(), weakref.finalize(), profile.Profile.runcall(), cProfile.Profile.runcall(), bdb.Bdb.runcall(), trace.Trace.runfunc() and curses.wrapper(). - "function" in unittest.addModuleCleanup() and unittest.TestCase.addCleanup(). - "fn" in the submit() method of concurrent.futures.ThreadPoolExecutor and concurrent.futures.ProcessPoolExecutor. - "callback" in contextlib.ExitStack.callback(), contextlib.AsyncExitStack.callback() and contextlib.AsyncExitStack.push_async_callback(). - "c" and "typeid" in the create() method of multiprocessing.managers.Server and multiprocessing.managers.SharedMemoryServer. - "obj" in weakref.finalize(). Also allowed to pass arbitrary keyword arguments (even "self" and "func") if the above arguments are passed as positional argument.
* Use assertEqual to fix DeprecationWarning. (GH-10794)Xtreak2018-11-291-1/+1
|
* bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190)Lisa Roach2018-11-091-4/+606
|
* bpo-32230: Set sys.warnoptions with -X dev (#4820)Victor Stinner2017-12-121-1/+1
| | | | | | | | | | | | | | Rather than supporting dev mode directly in the warnings module, this instead adjusts the initialisation code to add an extra 'default' entry to sys.warnoptions when dev mode is enabled. This ensures that dev mode behaves *exactly* as if `-Wdefault` had been passed on the command line, including in the way it interacts with `sys.warnoptions`, and with other command line flags like `-bb`. Fix also bpo-20361: have -b & -bb options take precedence over any other warnings options. Patch written by Nick Coghlan, with minor modifications of Victor Stinner.
* Fix ResourceWarning in test_unittest when interruptedVictor Stinner2016-03-291-3/+6
|
* Issue #22936: Allow showing local variables in unittest errors.Robert Collins2015-03-061-3/+7
|
* #22092: use absolute imports in unittest tests. Patch by Vajrasky Kok.Ezio Melotti2014-08-071-1/+2
|
* Issue #19013: add unittest.main() epilogs to unittest's own test modulesAntoine Pitrou2013-09-131-0/+4
|
* clean the environment from pre-existing PYTHONWARNINGS for test_warningsŁukasz Langa2013-04-231-0/+12
|\
| * clean the environment from pre-existing PYTHONWARNINGS for test_warningsŁukasz Langa2013-04-231-0/+12
| |
* | Issue #16997: unittest.TestCase now provides a subTest() context manager to ↵Antoine Pitrou2013-03-201-7/+5
|/ | | | procedurally generate, in an easy way, small test instances.
* Closes issue #12376 : Pass on parameters in unittest.TextTestResult.__init__ ↵Michael Foord2012-09-281-0/+13
| | | | super call
* Issue 10786: unittest.TextTestRunner default stream no longer bound at ↵Michael Foord2010-12-301-0/+17
| | | | import time
* Issue 10611. Issue 9857. Improve the way exception handling, including test ↵Michael Foord2010-12-191-11/+8
| | | | skipping, is done inside TestCase.run
* Fix test failure in debug builds and add NEWS entry for r86908Ezio Melotti2010-12-011-3/+3
|
* #10535: Enable silenced warnings in unittest by defaultEzio Melotti2010-12-011-0/+58
|
* Merged revisions 81853 via svnmerge fromMichael Foord2010-06-101-0/+25
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81853 | michael.foord | 2010-06-08 23:44:52 +0100 (Tue, 08 Jun 2010) | 1 line Issue 8948. cleanup functions are not run by unittest.TestCase.debug(), plus class and module teardowns are not run by unittest.TestSuite.debug(). ........
* Merged revisions 80920 via svnmerge fromMichael Foord2010-05-071-0/+46
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80920 | michael.foord | 2010-05-07 17:52:05 +0200 (Fri, 07 May 2010) | 1 line Adding tests for unittest command line handling of buffer, catchbreak and failfast. ........
* Breaking test_unittest.py into a package. Manual merge of revision 79432.Michael Foord2010-03-271-0/+175