Add typing for all the TestCase functions.
Review Request #13413 — Created Nov. 14, 2023 and submitted
This updates all the object creation functions and utility context
managers inTestCase
to provide type hints. This helps to write better
type-safe unit tests, and resolves a lot of problems that currently
exist when passing in values that default toNone
or accept multiple
value types.In the process, documentation has been updated to meet current standards.
There are a couple of fixes in here. For instance,
create_visit()
ignored thetimestamp
field and didn't normalizeuser
correctly, and
http_request()
passed in bad empty arguments when constructing a
ResolverMatch
. These have been addressed.
All unit tests pass.
Summary | ID |
---|---|
9387935ea0bda2c90813a8a76b66024ee2bf4857 |
Description | From | Last Updated |
---|---|---|
This doesn't seem like a valuable thing to include in the version changed documentation. Type hints don't change the signature … |
david |
- Change Summary:
-
Removed all
Version Changed
blocks talking about type hints. - Commits:
-
Summary ID 3e8c036bb2a47abe8b665e78c31794d4580912cf 9387935ea0bda2c90813a8a76b66024ee2bf4857 - Diff:
-
Revision 2 (+1042 -480)