Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | bpo-44185: Added close() to mock_open __exit__ (#26902) | Samet YASLAN | 2023-06-11 | 1 | -0/+4 |
| | |||||
* | gh-94924: support `inspect.iscoroutinefunction` in ↵ | Thomas Grainger | 2023-06-09 | 1 | -2/+30 |
| | | | | | | | | | | `create_autospec(async_def)` (#94962) * support inspect.iscoroutinefunction in create_autospec(async_def) * test create_autospec with inspect.iscoroutine and inspect.iscoroutinefunction * test when create_autospec functions check their signature | ||||
* | gh-105407: Remove unused imports in the stdlib (#105411) | Victor Stinner | 2023-06-06 | 1 | -1/+0 |
| | |||||
* | gh-104992: Remove deprecated unittest.TestProgram.usageExit (#104993) | Hugo van Kemenade | 2023-05-27 | 1 | -10/+0 |
| | |||||
* | gh-104835: Remove unittest's deprecated getTestCaseNames, makeSuite, ↵ | Hugo van Kemenade | 2023-05-24 | 2 | -49/+0 |
| | | | | findTestCases (#104836) | ||||
* | gh-85934: Use getattr_static when adding mock spec (#22209) | melanie witt | 2023-05-23 | 1 | -1/+7 |
| | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> | ||||
* | gh-68968: Correcting message display issue with assertEqual (#103937) | Michael Blahay | 2023-05-04 | 1 | -8/+23 |
| | |||||
* | gh-62432: unittest runner: Exit code 5 if no tests were run (#102051) | Stefano Rivera | 2023-04-27 | 2 | -1/+10 |
| | | | | | | | | As discussed in https://discuss.python.org/t/unittest-fail-if-zero-tests-were-discovered/21498/7 It is common for test runner misconfiguration to fail to find any tests, This should be an error. Fixes: #62432 | ||||
* | gh-48330: address review comments to PR-12271 (#103209) | Giampaolo Rodola | 2023-04-16 | 1 | -1/+5 |
| | | | | | address review comments to PR-12271 Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com> | ||||
* | gh-102978: Fix mock.patch function signatures for class and staticmethod ↵ | Tomas R | 2023-04-13 | 1 | -0/+6 |
| | | | | | | | decorators (#103228) Fixes unittest.mock.patch not enforcing function signatures for methods decorated with @classmethod or @staticmethod when patch is called with autospec=True. | ||||
* | bpo-4080: unittest durations (#12271) | Giampaolo Rodola | 2023-04-02 | 4 | -6/+67 |
| | |||||
* | Remove unused import of `warnings` from `unittest.loader` (#102479) | JosephSBoyle | 2023-03-06 | 1 | -1/+0 |
| | |||||
* | gh-96127: Fix `inspect.signature` call on mocks (#96335) | Nikita Sobolev | 2023-01-07 | 1 | -1/+9 |
| | |||||
* | gh-100690: [mock] hide `ATTRIB_DENY_LIST` and make it immutable (#100819) | Nikita Sobolev | 2023-01-07 | 1 | -2/+6 |
| | |||||
* | gh-100690: Raise an AttributeError when the assert_ prefix is forgotten when ↵ | Christian Klein | 2023-01-06 | 1 | -4/+10 |
| | | | | | | | | using Mock (#100691) Mock objects which are not unsafe will now raise an AttributeError when accessing an attribute that matches the name of an assertion but without the prefix `assert_`, e.g. accessing `called_once` instead of `assert_called_once`. This is in addition to this already happening for accessing attributes with prefixes assert, assret, asert, aseert, and assrt. | ||||
* | gh-100739: Respect mock spec when checking for unsafe prefixes (#100740) | Christian Klein | 2023-01-04 | 1 | -1/+1 |
| | | | Co-authored-by: Nikita Sobolev <mail@sobolevn.me> | ||||
* | gh-100287: Fix unittest.mock.seal with AsyncMock (#100496) | Shantanu | 2022-12-24 | 1 | -4/+4 |
| | |||||
* | gh-99482: remove `jython` compatibility parts from stdlib and tests (#99484) | Nikita Sobolev | 2022-12-23 | 1 | -7/+5 |
| | |||||
* | gh-83076: 3.8x speed improvement in (Async)Mock instantiation (#100252) | Carl Meyer | 2022-12-23 | 1 | -16/+22 |
| | |||||
* | gh-98458: unittest: bugfix for infinite loop while handling chained ↵ | AlexTate | 2022-12-04 | 1 | -1/+3 |
| | | | | | | | exceptions that contain cycles (#98459) * Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks() * Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you @iritkatriel for pointing it out) * adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes | ||||
* | gh-99645: Fix a bug in handling class cleanups in unittest.TestCase (GH-99646) | Serhiy Storchaka | 2022-11-22 | 1 | -5/+5 |
| | | | | | Now addClassCleanup() uses separate lists for different TestCase subclasses, and doClassCleanups() only cleans up the particular class. | ||||
* | gh-98086: Now ``patch.dict`` can decorate async functions (#98095) | Nikita Sobolev | 2022-11-11 | 1 | -0/+18 |
| | |||||
* | gh-91803: Mock - fix error when using autospec methods with seal (#92213) | andrei kulakov | 2022-11-07 | 1 | -0/+1 |
| | | | | | | Fixes https://github.com/python/cpython/issues/91803. Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | ||||
* | gh-98624 Add mutex to unittest.mock.NonCallableMock (#98688) | noah-weingarden | 2022-10-28 | 1 | -28/+38 |
| | | | | | | | | | | | * Added lock to NonCallableMock in unittest.mock * Add blurb * Nitpick blurb * Edit comment based on @Jason-Y-Z's review * Add link to GH issue | ||||
* | gh-97837: Change deprecation warning message in `unittest` (#97838) | Nikita Sobolev | 2022-10-05 | 2 | -2/+2 |
| | |||||
* | gh-95736: Fix event loop creation in IsolatedAsyncioTestCase (GH-96033) | Serhiy Storchaka | 2022-08-17 | 1 | -4/+4 |
| | | | | | | It should be created before calling the setUp() method, but after checking for skipping a test. Automerge-Triggered-By: GH:tiran | ||||
* | GH-95736: fix IsolatedAsyncioTestCase to initialize Runner before calling ↵ | Kumar Aditya | 2022-08-16 | 1 | -0/+4 |
| | | | | setup functions (#95898) | ||||
* | gh-84753: Make inspect.iscoroutinefunction() work with AsyncMock (#94050) | Mehdi ABAAKOUK | 2022-06-30 | 1 | -0/+4 |
| | | | | | | | | | The inspect version was not working with unittest.mock.AsyncMock. The fix introduces special-casing of AsyncMock in `inspect.iscoroutinefunction` equivalent to the one performed in `asyncio.iscoroutinefunction`. Co-authored-by: Łukasz Langa <lukasz@langa.pl> | ||||
* | Revert "bpo-45162: Revert "Remove many old deprecated unittest features"" ↵ | Serhiy Storchaka | 2022-06-26 | 4 | -85/+1 |
| | | | | | | (GH-92556) This reverts commit b50322d20337ca468f2070eedb051a16ee1eba94. | ||||
* | gh-93839: Move Lib/unttest/test/ to Lib/test/test_unittest/ (#94043) | Victor Stinner | 2022-06-21 | 31 | -18402/+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 Storchaka | 2022-05-08 | 5 | -2/+218 |
| | | | | | | Add methods enterContext() and enterClassContext() in TestCase. Add method enterAsyncContext() in IsolatedAsyncioTestCase. Add function enterModuleContext(). | ||||
* | gh-57684: Update tests for PYTHONSAFEPATH=1 (#92358) | Victor Stinner | 2022-05-06 | 1 | -1/+3 |
| | | | | | Fix tests failing with the PYTHONSAFEPATH=1 env var. Enhance also -P help in Python usage (python --help). | ||||
* | Simplify testing the warning filename (GH-91868) | Serhiy Storchaka | 2022-04-24 | 3 | -15/+15 |
| | | | The context manager result has the "filename" attribute. | ||||
* | bpo-14265: Adds fully qualified test name to unittest output (GH-32138) | Sam Ezeh | 2022-03-29 | 2 | -35/+41 |
| | | | Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com> | ||||
* | bpo-47062: Implement asyncio.Runner context manager (GH-31799) | Andrew Svetlov | 2022-03-24 | 1 | -51/+19 |
| | | | Co-authored-by: Zachary Ware <zach@python.org> | ||||
* | bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986) | Christian Heimes | 2022-03-22 | 5 | -1/+12 |
| | | | | | | | | | | | - 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-46421: Fix unittest filename evaluation when called as a module (GH-30654) | Bader Zaidan | 2022-03-17 | 1 | -1/+1 |
| | |||||
* | bpo-22859: deprecate unittest.main.TestProgram.usageExit (GH-30293) | Carlos Damazio | 2022-03-17 | 1 | -0/+3 |
| | | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> | ||||
* | bpo-46994: Accept explicit contextvars.Context in asyncio create_task() API ↵ | Andrew Svetlov | 2022-03-14 | 2 | -38/+35 |
| | | | | (GH-31837) | ||||
* | bpo-24959: fix unittest.assertRaises bug where traceback entries are dropped ↵ | Irit Katriel | 2022-03-08 | 2 | -14/+94 |
| | | | | from chained exceptions (GH-23688) | ||||
* | bpo-46877: export unittest.doModuleCleanups in unittest package (#31613) | Kumar Aditya | 2022-03-03 | 1 | -2/+2 |
| | |||||
* | bpo-46852: Remove the float.__set_format__() method (GH-31585) | Victor Stinner | 2022-02-25 | 1 | -1/+1 |
| | | | | | | Remove the undocumented private float.__set_format__() method, previously known as float.__set_format__() in Python 3.7. Its docstring said: "You probably don't want to use this function. It exists mainly to be used in Python's test suite." | ||||
* | bpo-46709: check eval breaker in specialized `CALL` opcodes (GH-31404) | Nikita Sobolev | 2022-02-18 | 1 | -59/+85 |
| | |||||
* | Restrict use of Mock objects as specs (GH-31090) | Matthew Suozzo | 2022-02-03 | 3 | -3/+19 |
| | | | | | Follow-on to https://github.com/python/cpython/pull/25326 This covers cases where mock objects are passed directly to spec. | ||||
* | bpo-45162: Revert "Remove many old deprecated unittest features" (GH-30935) | Gregory P. Smith | 2022-01-27 | 10 | -25/+323 |
| | | | | | | | | | | 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-41403: Improve error message for invalid mock target (GH-30833) | Irit Katriel | 2022-01-23 | 2 | -5/+10 |
| | |||||
* | bpo-46425: Fix direct invocation of multiple test modules (GH-30666) | Nikita Sobolev | 2022-01-18 | 1 | -1/+1 |
| | |||||
* | bpo-23882: unittest: Drop PEP 420 support from discovery. (GH-29745) | Inada Naoki | 2022-01-10 | 2 | -76/+15 |
| | |||||
* | bpo-22815: Print unexpected successes in summary in TextTestResult (GH-30138) | Serhiy Storchaka | 2021-12-26 | 2 | -8/+38 |
| | |||||
* | bpo-46129: Rewrite asyncio.locks tests with IsolatedAsyncioTestCase (GH-30198) | Andrew Svetlov | 2021-12-19 | 1 | -1/+0 |
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> |