Releases: nyggus/easycheck
Improved pytest handling
This release comes with the improved handling of pytest testing, thanks to the simplified traceback. Now, when a pytest test fails using an easycheck function, the traceback does not show all the intermediate functions that easycheck used to run its assertion functions. In addition, the package has a new co-author, Karollayna.
Move to pyproject.toml
This release comes with a big change in the internal structure of easycheck. Currently, it uses the pyproject.toml modern structure of a Python project and package, and instead of setuptools-based building backend, it uses the build-based backend.
Annotations
This release comes with type hints for easycheck functions.
Switcher
This is a big release, with two important functionalities added:
easycheckfunctions can be switched off using an environmental variable- assertion functions work just like assertions, so when
__debug__isTrue
Additional functionalities are related to the repository and documentation:
- badges were added
- CI was set up in GitHub actions
Optimize easycheck
This release comes with a significant performance improvement. Previously, easycheck functions ran various validations of their arguments, and used check_if() and some other easycheck functions to run checks. Many of the validations are removed, as Python runs them anyway. All check_if() checks were replaced with the corresponding if-based checks. That way, easycheck is much faster, sometimes almost up to 100 times.
This is not the end of the optimizations. In future releases, the _raise function, used by all easycheck functions, will be improved in terms of performance. Maybe all instances of easycheck functions run by other easycheck functions will be replaced with the corresponding if-checks, but this may lead to a far more complicated code.
Check if in limits
The release comes with a new function, check_if_in_limits, and its testing alias, assert_if_in_limits.
Type checking with `check_type()`
Now you can check an object's type with a check_type() function. For backward compatibility, the previous name, check_instance(), is kept, and will be kept for some time.
v0.3.2
Improved messages
This release comes with improved messaging. For custom exception classes, if a message is not provided, the docstring of exception class is taken as the message (this is the default). For built-in exceptions, the default behavior is to not print any message.