Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | bpo-32972: Async test case (GH-13386) | Andrew Svetlov | 2019-05-29 | 1 | -4/+16 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add explicit `asyncSetUp` and `asyncTearDown` methods. The rest is the same as for #13228 `AsyncTestCase` create a loop instance for every test for the sake of test isolation. Sometimes a loop shared between all tests can speed up tests execution time a lot but it requires control of closed resources after every test finish. Basically, it requires nested supervisors support that was discussed with @1st1 many times. Sorry, asyncio supervisors have no chance to land on Python 3.8. The PR intentionally does not provide API for changing the used event loop or getting the test loop: use `asyncio.set_event_loop_policy()` and `asyncio.get_event_loop()` instead. The PR adds four overridable methods to base `unittest.TestCase` class: ``` def _callSetUp(self): self.setUp() def _callTestMethod(self, method): method() def _callTearDown(self): self.tearDown() def _callCleanup(self, function, /, *args, **kwargs): function(*args, **kwargs) ``` It allows using asyncio facilities with minimal influence on the unittest code. The last but not least: the PR respects contextvars. The context variable installed by `asyncSetUp` is available on test, `tearDown` and a coroutine scheduled by `addCleanup`. https://bugs.python.org/issue32972 | ||||
* | bpo-36542: Allow to overwrite the signature for Python functions. (GH-12705) | Serhiy Storchaka | 2019-05-06 | 1 | -1/+4 |
| | |||||
* | Document that TestCase.assertCountEqual() can take iterables (GH-686) | jkleint | 2019-04-23 | 1 | -3/+2 |
| | |||||
* | bpo-36492: Deprecate passing some arguments as keyword arguments. (GH-12637) | Serhiy Storchaka | 2019-04-01 | 1 | -3/+41 |
| | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190) | Lisa Roach | 2018-11-09 | 1 | -1/+45 |
| | |||||
* | bpo-34900: Make TestCase.debug() work with subtests (GH-9707) | Bruno Oliveira | 2018-10-12 | 1 | -1/+1 |
| | |||||
* | bpo-34318: Convert deprecation warnings to errors in assertRaises() etc. ↵ | Serhiy Storchaka | 2018-08-19 | 1 | -7/+2 |
| | | | | (GH-8623) | ||||
* | Update TestCase.assertAlmostEqual and assertNotAlmostEqual docstrings. (GH-3998) | Ron | 2017-10-18 | 1 | -2/+3 |
| | | | | The word "difference" from missing the sentence. This clarifies that it compares the difference between the two objects. | ||||
* | bpo-30397: Add re.Pattern and re.Match. (#1646) | Serhiy Storchaka | 2017-10-04 | 1 | -2/+2 |
| | |||||
* | bpo-30664: The description of a unittest subtest now preserves the (#2265) | Serhiy Storchaka | 2017-06-23 | 1 | -2/+12 |
| | | | | order of keyword arguments of TestCase.subTest(). | ||||
* | bpo-30190: improved error msg for assertAlmostEqual(delta=...) (#1331) | Giampaolo Rodola | 2017-05-01 | 1 | -14/+21 |
| | | | | | | | | | | | | * #30190 / unittest / assertAlmostEqual(delta=...) / error msg: show the difference between the 2 numbers in case of failure * safe_repr() diff * also show difference when passing 'places' argument * refactoring * update Misc/NEWS | ||||
* | Fix ref cycles in TestCase.assertRaises() (#193) | Victor Stinner | 2017-03-27 | 1 | -22/+30 |
| | | | | bpo-23890: unittest.TestCase.assertRaises() now manually breaks a reference cycle to not keep objects alive longer than expected. | ||||
* | Issue #25651: Allow falsy values to be used for msg parameter of subTest() | Berker Peksag | 2016-09-21 | 1 | -2/+3 |
| | |||||
* | Issue #27626: Spelling fixes in docs, comments and internal names | Martin Panter | 2016-07-28 | 1 | -2/+2 |
| | | | | Based on patch by Ville Skyttä. | ||||
* | Issue #26837: assertSequenceEqual() now correctly outputs non-stringified | Serhiy Storchaka | 2016-04-25 | 1 | -3/+3 |
| | | | | | differing items (like bytes in the -b mode). This affects assertListEqual() and assertTupleEqual(). | ||||
* | Issue #21112: Fix regression in unittest.expectedFailure on subclasses. | Robert Collins | 2015-08-27 | 1 | -2/+5 |
|\ | | | | | | | Patch from Berker Peksag. | ||||
| * | Issue #21112: Fix regression in unittest.expectedFailure on subclasses. | Robert Collins | 2015-08-27 | 1 | -2/+5 |
| | | | | | | | | Patch from Berker Peksag. | ||||
| * | Reverted issue #24134 changes (except new tests). | Serhiy Storchaka | 2015-05-16 | 1 | -13/+11 |
| | | |||||
* | | Issue #20362: Honour TestCase.longMessage correctly in assertRegex. | Robert Collins | 2015-08-19 | 1 | -7/+11 |
| | | | | | | | | Patch from Ilia Kurenkov. | ||||
* | | Issue #15836: assertRaises(), assertRaisesRegex(), assertWarns() and | Serhiy Storchaka | 2015-05-21 | 1 | -0/+13 |
| | | | | | | | | | | assertWarnsRegex() assertments now check the type of the first argument to prevent possible user error. Based on patch by Daniel Wagner-Hall. | ||||
* | | Issue #24134: assertRaises(), assertRaisesRegex(), assertWarns() and | Serhiy Storchaka | 2015-05-16 | 1 | -44/+44 |
|/ | | | | | assertWarnsRegex() checks now emits a deprecation warning when callable is None or keyword arguments except msg is passed in the context manager mode. | ||||
* | Fixed English in error message. | Serhiy Storchaka | 2015-05-06 | 1 | -1/+1 |
| | |||||
* | Issue #24134: assertRaises(), assertRaisesRegex(), assertWarns() and | Serhiy Storchaka | 2015-05-06 | 1 | -11/+13 |
| | | | | | | assertWarnsRegex() checks are not longer successful if the callable is None. Added tests for assertRaises(). | ||||
* | Issue #21408: The default __ne__() now returns NotImplemented if __eq__() | Serhiy Storchaka | 2015-01-26 | 1 | -3/+0 |
| | | | | returned NotImplemented. Removed incorrect implementations of __ne__(). | ||||
* | Issue #9815: assertRaises now tries to clear references to local variables ↵ | Antoine Pitrou | 2014-04-28 | 1 | -0/+3 |
| | | | | in the exception's traceback. | ||||
* | backport: #20145: assert[Raises|Warns]Regex now raise TypeError on bad regex. | R David Murray | 2014-03-25 | 1 | -1/+1 |
| | | | | | | | Previously a non-string, non-regex second argument and missing callable argument could cause the test to appear to always pass. Initial patch by Kamilla Holanda. | ||||
* | Close #19880: Fix a reference leak in unittest.TestCase. Explicitly break | Victor Stinner | 2013-12-09 | 1 | -1/+13 |
| | | | | reference cycles between frames and the _Outcome instance. | ||||
* | Issue #18996: TestCase.assertEqual() now more cleverly shorten differing | Serhiy Storchaka | 2013-09-23 | 1 | -13/+7 |
| | | | | strings in error report. | ||||
* | Issue #18937: Add an assertLogs() context manager to unittest.TestCase to ↵ | Antoine Pitrou | 2013-09-14 | 1 | -6/+103 |
| | | | | ensure that a block of code emits a message using the logging module. | ||||
* | #8906: merge with 3.3. | Ezio Melotti | 2013-03-29 | 1 | -12/+11 |
|\ | |||||
| * | #8906: document failureException, longMessage, and maxDiff in the class ↵ | Ezio Melotti | 2013-03-29 | 1 | -12/+11 |
| | | | | | | | | docstring. Patch by Boris Feld. | ||||
* | | #17329: merge with 3.3. | Ezio Melotti | 2013-03-27 | 1 | -1/+1 |
|\ \ | |/ | |||||
| * | #17329: merge with 3.2. | Ezio Melotti | 2013-03-27 | 1 | -1/+1 |
| |\ | |||||
| | * | #17329: document unittest.SkipTest. Initial patch by Zachary Ware. | Ezio Melotti | 2013-03-27 | 1 | -1/+1 |
| | | | |||||
* | | | Issue #16997: unittest.TestCase now provides a subTest() context manager to ↵ | Antoine Pitrou | 2013-03-20 | 1 | -86/+166 |
|/ / | | | | | | | procedurally generate, in an easy way, small test instances. | ||||
* | | Issue #16714: use 'raise' exceptions, don't 'throw'. | Andrew Svetlov | 2012-12-18 | 1 | -2/+2 |
|\ \ | |/ | | | | | Patch by Serhiy Storchaka. | ||||
| * | Issue #16714: use 'raise' exceptions, don't 'throw'. | Andrew Svetlov | 2012-12-18 | 1 | -2/+2 |
| | | | | | | | | Patch by Serhiy Storchaka. | ||||
* | | #16433: merge with 3.2. | Ezio Melotti | 2012-11-08 | 1 | -1/+1 |
|\ \ | |/ | |||||
| * | #16433: fix docstring of assertNotEqual. | Ezio Melotti | 2012-11-08 | 1 | -1/+1 |
| | | |||||
* | | compare singletons by identity not equality (closes #16712) | Benjamin Peterson | 2012-10-09 | 1 | -1/+1 |
| | | | | | | | | Patch from Serhiy Storchaka. | ||||
* | | Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a test ↵ | Antoine Pitrou | 2012-04-25 | 1 | -1/+1 |
|\ \ | |/ | | | | | class that doesn't inherit from TestCase (i.e. a mixin). | ||||
| * | Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a test ↵ | Antoine Pitrou | 2012-04-25 | 1 | -1/+1 |
| | | | | | | | | class that doesn't inherit from TestCase (i.e. a mixin). | ||||
* | | Drop unused import in unittest package. | Florent Xicluna | 2011-11-04 | 1 | -2/+1 |
| | | |||||
* | | #13012: use splitlines(keepends=True/False) instead of splitlines(0/1). | Ezio Melotti | 2011-09-28 | 1 | -2/+2 |
| | | |||||
* | | merge 3.2 (#12544) | Benjamin Peterson | 2011-07-13 | 1 | -22/+3 |
|\ \ | |/ | |||||
| * | this can be done without a custom dict (also fixes #12544) | Benjamin Peterson | 2011-07-13 | 1 | -22/+3 |
| | | |||||
* | | Issue #10775: assertRaises, assertRaisesRegex, assertWarns, and ↵ | Ezio Melotti | 2011-05-06 | 1 | -33/+47 |
| | | | | | | | | assertWarnsRegex now accept a keyword argument 'msg' when used as context managers. Initial patch by Winston Ewert. | ||||
* | | #11763: merge with 3.2. | Ezio Melotti | 2011-04-27 | 1 | -0/+8 |
|\ \ | |/ | |||||
| * | #11763: merge with 3.1. | Ezio Melotti | 2011-04-27 | 1 | -0/+8 |
| | | |||||
* | | #11282: add back the fail* methods and assertDictContainsSubset. | Ezio Melotti | 2011-04-03 | 1 | -5/+36 |
| | |