Jelle Zijlstra
ddfaca3200
stdlib: add argument default values ( #9501 )
2023-01-18 09:37:34 +01:00
Alex Waygood
352f496d69
Unpin stubtest from Python 3.10.8 and 3.11.0 ( #9368 )
2022-12-20 20:31:13 +00:00
Terrance
4661af99c3
Annotate unittest.TestCase.skipTest() as no-return ( #9352 )
...
Annotate unittest.TestCase.skipTest() as no-return
This method unconditionally raises unittest.SkipTest, which ends a test
method early. unittest.TestCase.fail() works similarly, and is already
annotated with NoReturn to indicate this behaviour.
2022-12-11 18:07:09 +00:00
Nikita Sobolev
18e2ae762b
Mark first argument of __[get|set|del]attr__ as str ( #9245 )
2022-11-22 11:06:50 +00:00
Jelle Zijlstra
1f7648976c
unittest: cannot use bytes regexes ( #9107 )
...
```
>>> from unittest.case import TestCase
>>> c = TestCase()
>>> with c.assertRaisesRegex(Exception, b"x"): 1/0
...
ZeroDivisionError: division by zero
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/case.py", line 274, in __exit__
if not expected_regex.search(str(exc_value)):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot use a bytes pattern on a string-like object
```
2022-11-05 14:14:53 -07:00
Sebastian Rittau
e7e94dd101
Make unittest.patch.* methods static ( #7543 )
2022-11-01 13:09:56 +01:00
Nikita Sobolev
380022c650
Remove empty __init__ methods ( #8816 )
2022-09-30 13:08:41 +01:00
Shane Harvey
1a2914adc5
Use Callable[..., Any] instead of Callable[..., object] in unittest ( #8399 )
2022-09-21 13:46:38 +01:00
Pierre Riandey
70d76ecf8f
Add types for unittest.loader.TestLoader._match_path ( #8669 )
2022-09-02 09:55:24 +02:00
MapleCCC
dece0b1fff
assertRaises / assertRaisesRegex / assertWarns / assertWarnsRegex: msg argument is keyword-only (#8631 )
2022-08-27 15:55:14 +01:00
Nikita Sobolev
0259068ad6
Remove duplicate definitions in sub-classes ( #8594 )
2022-08-26 17:10:55 +02:00
Nikita Sobolev
0480550fc3
Adds missing __dir__ definitions ( #8479 )
2022-08-04 12:21:43 +02:00
Shane Harvey
7a73660f3f
Fix hints for TestCase.assertRaises ( #8373 )
2022-07-23 10:43:38 +01:00
Alex Waygood
35616b439f
Run pycln as a pre-commit hook in CI ( #8304 )
2022-07-18 09:27:28 +02:00
Alex Waygood
6348a58b8b
Import Match and Pattern from re, not typing ( #8277 )
2022-07-12 15:32:48 +02:00
Alex Waygood
edc0ecd857
Remove Python 3.6 branches from typeshed ( #8269 )
2022-07-11 10:55:17 +02:00
Alex Waygood
fffb25201a
Delete some works of fiction ( #8247 )
2022-07-06 22:49:18 +05:30
Alex Waygood
208d8e1ec2
Fix assertAlmostEqual regression on mixed numeric types ( #8137 )
2022-06-27 08:57:36 +02:00
Alex Waygood
8b3b6bf7cd
stdlib: Audit Callable[<parameters>, None] annotations ( #8187 )
2022-06-27 08:08:28 +02:00
Alex Waygood
538621e91b
unittest.case: tighter annotations for various assertions (#8077 )
2022-06-20 18:49:57 +02:00
Alex Waygood
5add91d6bb
unittest: Improve self.assert(Not)AlmostEqual(s) (#8066 )
2022-06-14 18:24:51 +03:00
Alex Waygood
b88ea4a499
Simplify __all__ for unittest and xml.etree ( #8029 )
2022-06-07 12:03:52 -07:00
Alex Waygood
43a9ab08d7
Always use TypeAlias when assigning to Any ( #8021 )
2022-06-05 18:16:20 -07:00
Alex Waygood
0ce825b5a8
Add unittest features new in Python 3.11 ( #8020 )
...
python/cpython@086c6b1
2022-06-04 16:27:52 +01:00
Alex Waygood
acc0167dc1
Fix several new-in-3.11 stubtest errors ( #7973 )
2022-06-02 18:07:38 -07:00
Jelle Zijlstra
66383ee8e3
unittest.mock: target must be a str ( #7672 )
...
See [the CPython source](eaa85cb22f/Lib/unittest/mock.py (L1754) ). It calls `_get_target`, and [that](eaa85cb22f/Lib/unittest/mock.py (L1594) ) does `target.rsplit('.', 1)`.
2022-04-21 14:07:55 -07:00
Alex Waygood
a8504f269e
Use _typeshed.OptExcInfo in pydoc and unittest ( #7668 )
2022-04-20 21:00:48 +01:00
Alex Waygood
b093c90a94
Use TypeAlias for type aliases where possible, part II ( #7667 )
2022-04-20 20:02:47 +01:00
Alex Waygood
97a74bc1aa
Import from collections.abc wherever possible ( #7635 )
2022-04-18 12:50:37 +02:00
Alex Waygood
740193a8fc
Use TypeAlias where possible for type aliases ( #7630 )
2022-04-15 18:01:00 -07:00
Alex Waygood
da3e69d093
stdlib: Improve a bunch of __(a)exit__ methods ( #7571 )
2022-04-01 08:05:25 +02:00
Alex Waygood
1245bbcc8d
Use type alias to simplify overloads in unittest.mock ( #7563 )
2022-03-29 08:19:26 +02:00
Alex Waygood
340c6c97ed
Add mypy error codes to type: ignores, remove unused ignores ( #7504 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2022-03-19 13:10:00 +00:00
Alex Waygood
3ab250eec8
Use PEP 604 syntax wherever possible ( #7493 )
2022-03-16 16:01:33 +01:00
Alex Waygood
f4ae363b56
stdlib: correct many pos-or-kw arg names in dunder methods ( #7451 )
2022-03-07 16:40:03 +01:00
Itai Steinherz
b9909b121e
Add missing typings to unittest.mock ( #7431 )
2022-03-06 15:43:39 -08:00
Alex Waygood
58e505eeb2
Add __all__ for modules beginning with 'u', 'x', 'w' and 'z' ( #7374 )
2022-02-23 23:04:21 +01:00
Adam Johnson
816f13339a
Fix unittest.TextTestResult.printErrorList() ( #7341 )
2022-02-21 12:16:31 +02:00
Adam Johnson
bd365f7093
Fix unittest.TextTestResult showAll name ( #7340 )
2022-02-21 11:33:45 +02:00
Alex Waygood
1f6c691322
Add missing dunder overrides in array, tracemalloc and unittest.mock ( #7248 )
2022-02-17 13:22:33 +01:00
Alex Waygood
5a8b9dafb3
Fix various py310 stubtest errors ( #7239 )
2022-02-16 11:47:49 -08:00
Alex Waygood
fbc279e3f5
stdlib: Add many missing dunder overrides ( #7231 )
2022-02-16 06:25:47 -08:00
Alex Waygood
f4967618dd
Fix positional-only differences in many stdlib modules ( #7226 )
2022-02-15 15:14:06 +01:00
Alex Waygood
1371a1e1fe
unittest deprecations have been deferred until 3.12 ( #7131 )
...
See https://github.com/python/cpython/pull/30935
2022-02-04 15:52:30 -08:00
Alex Waygood
7ccbbdb30a
stdlib: Improve many __iter__ and constructor methods ( #7112 )
2022-02-02 19:14:57 +01:00
Shantanu
b88a6f19cd
Upgrade black version ( #7089 )
2022-01-30 16:27:06 -08:00
Alex Waygood
45a2dad83c
Reduce use of Any in equality methods ( #7081 )
...
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2022-01-30 00:59:00 +02:00
Nikita Sobolev
20508d05f4
Use ParamSpec in unittest.case ( #7012 )
2022-01-25 10:25:28 +01:00
Nikita Sobolev
dc176d70ec
Use ParamSpec in unittest.async_case ( #7011 )
2022-01-23 13:54:06 -08:00
Jelle Zijlstra
de5ec6a0d1
fix incorrect tuple[T] ( #6996 )
...
Found from PyCQA/flake8-pyi#135 .
2022-01-22 09:37:14 -08:00