Asserts

Latest version: v0.13.1

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

Scan your dependencies

Page 3 of 4

0.8.2

Added

- Add a py.typed file to signal that this package supports type hints.

0.8.1

Fixed

- `assert_raises_regex()`: Handle exceptions without any message correctly.

0.8.0

Added

- assert_count_equal(): Add `msg_fmt` argument.
- Add AssertRaisesErrnoContext, AssertRaisesRegexContext, and
AssertWarnsRegexContext.

Changed

- Replace `msg` argument with `msg_fmt` in all assertions (except `fail()`).
This allows you to customize error messages more easily than before, because
`format()` with appropriate keyword arguments is now called on these
strings. See the documentation of individual assertions for the supported
arguments.
- Replace AssertRaisesContext.msg and AssertWarnsContext.msg with msg_fmt.
- assert_almost_equal(), assert_not_almost_equal(): Place msg_fmt as third
argument.

0.7.3

Added

- Add assert_not_almost_equal().

Changed

- assert_almost_equal(): Raise ValueError if diff <= 0.

Fixed

- assert_almost_equal() would never fail if a delta was supplied and the
second number was smaller than the first.
- Use fail() instead of raise AssertionError in a few assertions.

0.7.2

Added

- Add assert_warns() and assert_warns_regex().

0.7.1

Changed

- Distribute a wheel.
- asserts is now a package, instead of a module.

Page 3 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.