Nikita Sobolev
1e4815692f
gh-120732: Fix `name` passing to `Mock`, when using kwargs to `create_autospec` ( #120737 )
2024-06-19 21:35:11 +01:00
infohash
b28a3339e4
gh-90848: Fixed create_autospec ignoring configure_mock style kwargs ( #118163 )
2024-05-02 18:36:35 +01:00
infohash
735fc2cbbc
gh-75988: Fix issues with autospec ignoring wrapped object ( #115223 )
...
* set default return value of functional types as _mock_return_value
* added test of wrapping child attributes
* added backward compatibility with explicit return
* added docs on the order of precedence
* added test to check default return_value
2024-03-08 19:14:32 +00:00
wookie184
1600d78e2d
gh-113569: Display calls in Mock.assert_has_calls failure when empty (GH-113573)
2024-01-04 21:11:34 +02:00
James
77dbd95609
gh-111019: Align expected and actual titles in test output ( #111020 )
...
Align expected and actual titles in output from
assert_has_calls/assert_called_with for greater readability
2023-10-18 08:36:16 +01:00
Sangyun_LEE
0c369d6cb8
Update Lib/test/test_unittest/testmock/testmock.py: fix typo RuntimError to RuntimeError ( #108847 )
2023-09-03 22:19:49 +01:00
Nikita Sobolev
219f01b185
gh-83403: Test `parent` param in `Mock.__init__` ( #103630 )
2023-05-30 08:36:22 +01:00
melanie witt
2e0931046d
gh-85934: Use getattr_static when adding mock spec ( #22209 )
...
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-05-23 17:10:34 -06:00
Chris Withers
4e544eafcb
fix up mock tests coverage ( #100874 )
2023-01-09 10:08:56 +00:00
Christian Klein
1d4d677d1c
gh-100690: Raise an AttributeError when the assert_ prefix is forgotten when 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.
2023-01-06 18:38:50 +00:00
Christian Klein
7f1eefc6f4
gh-100739: Respect mock spec when checking for unsafe prefixes ( #100740 )
...
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-01-04 22:31:29 +00:00
Victor Stinner
c735d54534
gh-93839: Move Lib/unttest/test/ to Lib/test/test_unittest/ ( #94043 )
...
* 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
2022-06-21 10:27:59 +02:00