python-asserts

Stand-alone Assertions for Python

MIT License

Downloads
34.4K
Stars
12
Committers
5

Bot releases are hidden (Show)

python-asserts - Release 0.13.0 Latest Release

Published by srittau 7 months ago

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().
python-asserts - Release 0.12.0

Published by srittau almost 2 years ago

Incompatible Changes

  • Drop support for Python 3.6.

API Additions

  • Add assert_not_regex().

Other Changes

  • Modernize the type stubs.
python-asserts - Release 0.11.1

Published by srittau almost 4 years ago

API Additions

  • 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.
python-asserts - Release 0.11.0

Published by srittau about 4 years ago

API-Incompatible Changes

  • Drop support for Python 2.7 and 3.5.
python-asserts - Release 0.10.0

Published by srittau almost 5 years ago

API-Incompatible Changes

  • Drop support for Python 3.4.

API Additions

  • AssertRaisesContext and AssertWarnsContext now return themselves
    when __enter__() is called. By extension it now easier to call
    add_test() with assert_raises() et al:
with assert_raises(KeyError) as context:
    context.add_test(...)
    ...
  • Add AssertRaisesContext.exc_val property to access the caught
    exception after leaving the context manager:
with assert_raises(KeyError) as context:
    ...
assert_equal("expected message", str(context.exc_val))
python-asserts - Release 0.9.1

Published by srittau over 5 years ago

Improvements

  • AssertRaisesContext and sub-classes are now generic over the
    exception type.
python-asserts - Release 0.9.0

Published by srittau about 6 years ago

API Additions

  • Add assert_json_subset().
python-asserts - Release 0.8.6

Published by srittau about 6 years ago

Improvements

  • Add support for Python 3.7 (contributed by Frank Niessink).
python-asserts - Release 0.8.5

Published by srittau about 6 years ago

API Additions

  • Add assert_dict_equal().
  • Add assert_dict_superset().

Improvements

  • assert_equal(): Use assert_dict_equal() if applicable.
python-asserts - Release 0.8.4

Published by srittau about 6 years ago

Improvements

  • fail() is now marked with NoReturn in type stub.

Bug Fixes

  • Improve type annotations for Python 2.
python-asserts - Release 0.8.3

Published by srittau over 6 years ago

  • Fix type signature of AssertRaisesContext.__exit__().
python-asserts - Release 0.8.2

Published by srittau over 6 years ago

Improvements

  • Add a py.typed file to signal that this package supports type hints.
python-asserts - Release 0.8.1

Published by srittau almost 7 years ago

Bug Fixes

  • assert_raises_regex(): Handle exceptions without any message correctly.
python-asserts - Release 0.8.0

Published by srittau almost 7 years ago

API-Incompatible Changes

  • 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.

API Additions

  • assert_count_equal(): Add msg_fmt argument.
  • Add AssertRaisesErrnoContext, AssertRaisesRegexContext, and
    AssertWarnsRegexContext.
python-asserts - Release 0.7.3

Published by srittau almost 7 years ago

API Additions

  • Add assert_not_almost_equal().

Improvements

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

Bug Fixes

  • 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.
python-asserts - Release 0.7.2

Published by srittau almost 7 years ago

API Additions

  • Add assert_warns() and assert_warns_regex().
python-asserts - Release 0.7.1

Published by srittau almost 7 years ago

Distribute as wheel.

python-asserts - Release 0.7.0

Published by srittau almost 7 years ago

  • Add a stub file.
  • Add assert_count_equal().
python-asserts - Release 0.6.0

Published by srittau about 8 years ago

Add assert_less(), assert_less_equal(), assert_greater(), assert_greater_equal(), assert_not_is_instance().

python-asserts - Release 0.5.1

Published by srittau over 10 years ago

First public release of the asserts package. This release still misses some assertions that are in the latest unittest module. Also, assert_equal does not support rich comparison support, yet.