| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
(GH-111020) (#111024)
gh-111019: Align expected and actual titles in test output (GH-111020)
Align expected and actual titles in output from
assert_has_calls/assert_called_with for greater readability
(cherry picked from commit 77dbd956090aac66e264d9d640f6adb6b0930b87)
Co-authored-by: James <morisja@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
(#109725)
gh-106584: Fix exit code for unittest in Python 3.12 (GH-106588)
(cherry picked from commit 8fc071345b50dd3de61ebeeaa287ccef21d061b2)
Co-authored-by: EliseevEgor <egor.eliseev@jetbrains.com>
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
| |
(GH-100497) (#109327)
gh-84867: Do not load tests from TestCase and FunctionTestCase (GH-100497)
(cherry picked from commit 66d1d7eb067d445f1ade151f4a6db3864dd9109f)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
| |
(#106888)
gh-104090: Fix unittest collectedDurations resources leak (GH-106795)
(cherry picked from commit 70b961ed93f67e34d0624e178f6029c886afaeee)
Co-authored-by: Yonatan Bitton <bityob@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
address review comments to PR-12271
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
|
|
|
|
|
|
|
| |
decorators (#103228)
Fixes unittest.mock.patch not enforcing function signatures for methods
decorated with @classmethod or @staticmethod when patch is called with
autospec=True.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Now addClassCleanup() uses separate lists for different TestCase subclasses,
and doClassCleanups() only cleans up the particular class.
|
| |
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
| |
It should be created before calling the setUp() method, but after
checking for skipping a test.
Automerge-Triggered-By: GH:tiran
|
|
|
|
| |
setup functions (#95898)
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
(GH-92556)
This reverts commit b50322d20337ca468f2070eedb051a16ee1eba94.
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
| |
Add methods enterContext() and enterClassContext() in TestCase.
Add method enterAsyncContext() in IsolatedAsyncioTestCase.
Add function enterModuleContext().
|
|
|
|
|
| |
Fix tests failing with the PYTHONSAFEPATH=1 env var.
Enhance also -P help in Python usage (python --help).
|
|
|
| |
The context manager result has the "filename" attribute.
|
|
|
| |
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
|
|
|
| |
Co-authored-by: Zachary Ware <zach@python.org>
|
|
|
|
|
|
|
|
|
|
|
| |
- 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).
|
| |
|
|
|
|
| |
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
| |
(GH-31837)
|
|
|
|
| |
from chained exceptions (GH-23688)
|
| |
|
|
|
|
|
|
| |
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."
|
| |
|
|
|
|
|
| |
Follow-on to https://github.com/python/cpython/pull/25326
This covers cases where mock objects are passed directly to spec.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
| |
|
|
|
| |
It can prevent some losses when output to buffered stream.
|