Delayed/soft assertions for python
Project description
Python-Delayed-Assert
Delayed aka. Soft asserts for python
Few features:
- No Dependenices on any other framework/library.
- Should work with any testing framework.
- Can be use as decorator or context manager.
Installation
Install via pip
pip install delayed-assert
Install from master
pip install git+https://github.com/pr4bh4sh/python-delayed-assert
Uses
See ExampleUnittest.py
for usage.
Using assertion library with lambda
Pass the assertion call as
lambda: self.assertListEqual([4,5,6,2,5],[7,8])
While I've tested only with unittest asserttion,It should be able to use any assertion library.
Keep in mind that, Python does not support statement inside lambda, so
lambda: assert 1 == 1
won't work as it is not a valid lambda expression in python
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
delayed_assert-0.3.1.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for delayed_assert-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efbb87ad51025c1372c5ba7f5325af5ff1312c591527f00c7530b0051203e02b |
|
MD5 | 0dbf249d1e522a05e1783b9a6e9a10a0 |
|
BLAKE2b-256 | 2fa5529a44e68b82054dabdb4234a97ee2ff154ecfa9620d54a8b113498f92cc |