Asserts

Latest version: v0.13.1

Safety actively analyzes 681857 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.13.1

Fixed

Fixed Python 3.12 deprecation warnings.

0.13.0

Added

- Add support for Python 3.12.
- Add `Present` and `Absent` for absence checks in `assert_json_subset()`.

Removed

- Drop support for Python 3.7.

Deprecated

- Deprecate `Exists` in favor of `Present` and `Absent` in
`assert_json_subset()`.

0.12.0

Added

- Add `assert_not_regex()`.

Changed

- Modernize the type stubs.

Removed

- Drop support for Python 3.6.

0.11.1

Added

- `assert_json_subset()` can now check for the existence or non-existence
of object members using the new `Exists` helper.
- Non-string (or `Exists`) object member names in the first argument to
`assert_json_subset()` now raise a `TypeError`.

0.11.0

Removed

- Drop support for Python 2.7 and 3.5.

0.10.0

Added

- `AssertRaisesContext` and `AssertWarnsContext` now return themselves
when `__enter__()` is called. By extension it now easier to call
`add_test()` with `assert_raises()` et al:

python
with assert_raises(KeyError) as context:
context.add_test(...)
...


- Add `AssertRaisesContext.exc_val` property to access the caught
exception after leaving the context manager:

python
with assert_raises(KeyError) as context:
...
assert_equal("expected message", str(context.exc_val))


Removed

- Drop support for Python 3.4.

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.