| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
(GH-108929) (#108954)
gh-108927: Fix test_import + test_importlib + test_unittest problem (GH-108929)
(cherry picked from commit 3f89b257639dd817a32079da2ae2c4436b8e82eb)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
|
|
| |
(GH-106737) (#108006)
gh-106300: Improve errors testing in test_unittest.test_runner (GH-106737)
Use a custom exception to prevent unintentional silence of actual errors.
(cherry picked from commit fd9d70a94de5b0756b52b9ae21e236e25545db4f)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
| |
(GH-106302) (GH-106534)
gh-106300: Improve `assertRaises(Exception)` usages in tests (GH-106302)
(cherry picked from commit 6e6a4cd52332017b10c8d88fbbbfe015948093f4)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
addDuration (#103309)
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
Remove skipped test.
See discussion on https://github.com/python/cpython/pull/25326.
Fix is apparently here, but no-one is confident to review and land: https://github.com/python/cpython/pull/25347.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
| |
* Update test_dotted_but_module_not_loaded to reflect the move of unittest.test to test.test_unittest.
|
|
|
|
|
|
|
|
|
| |
(GH-96135)
Tests for IsolatedAsyncioTestCase.debug() rely on the runner be closed
in __del__. It makes tests depending on the GC an unreliable on other
implementations. It is better to close the runner explicitly even if
currently there is no a public API for this.
|
|
|
|
| |
setup functions (#95898)
|
| |
|
|
|
|
|
|
| |
(GH-92556)
This reverts commit b50322d20337ca468f2070eedb051a16ee1eba94.
|
| |
|
|
|
|
|
| |
Fixes failing tests on WebAssembly platforms.
Automerge-Triggered-By: GH:tiran
|
|
* 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
|