typing.ParamSpec
Capture a callable’s parameter list so a decorator can preserve positional and keyword call rules in static types.
CKTIS / Python
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Capture a callable’s parameter list so a decorator can preserve positional and keyword call rules in static types.
Define a structural interface for static checking.
Mark a TypedDict key as mandatory even when total=False makes the other keys omissible.
Enable an isinstance test for a protocol using the presence of members.
Refer to the current class as specialized for the receiver, so inherited fluent methods preserve the subclass in static analysis.
typing.Tuple describes tuple element types. Deprecated since Python 3.9, it should be replaced with tuple[...] in new code.
Mark an assignment as a type alias for static analysis.
Describe a dictionary schema with known string keys and a separate value type for each.
Give a Boolean predicate a positive narrowing rule for its first positional argument in static analysis.
Relate parameter and result types through one variable inferred by a type checker.
Represent values that belong to at least one member type.
unittest.defaultTestLoader is a ready-made TestLoader instance that builds test suites without creating a separate loader.
Marks a known failing test so an observed failure is recorded as expected.
Discovers tests from a module and runs them using a configured runner.
Marks a test to be skipped unconditionally and records the reason.
Skips a test when its supplied condition is true.
Defines a fixture-backed test with assertion methods and a lifecycle managed by the test runner.
Builds test suites by discovering methods according to the configured name prefix.
`unittest.TestResult.errors` pairs the object associated with each error with a formatted traceback string. With the default `failureException` (`AssertionError`), assertion failures in test methods not marked with `expectedFailure` are recorded separately in `failures`.
unittest.TestResult.failures stores assertion failures as pairs containing a test object and formatted traceback text.
The unittest.TestResult.testsRun attribute reports the total number of tests run so far, not the number of tests that passed.
The wasSuccessful() method reports whether results recorded so far contain no failures, errors, or unexpected successes. It does not run tests itself.
Groups test cases and nested suites for one run, accumulating results in the supplied result object.
Runs a case or suite and writes a human-readable test report to the configured text stream.