Fix type hints for unorderable_list_difference()
It claimed that the arguments were `Sequence` types (immutable), but the function removes elements from them, so they must be `MutableSequence` types. Specifically, it calls `pop()` on the first argument and `remove()` on the second argument.
See the function implementation for details:
0b06d2482d/Lib/unittest/util.py (L98-L113)
And harmonise some annotations between the stdlib `unittest.mock` module and the third-party `mock` backport package.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Continuing work towards #8988.
The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are:
- Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine)
- Defaults in non-py311 branches
- Defaults for float parameters
- Defaults for overloads
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.
```
>>> 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
```