Pytest-check

Latest version: v2.4.1

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

Scan your dependencies

Page 3 of 7

2.1.3

Added

- publish-to-pypi.yml workflow

2.1.2

Changed

- README.md - clean up documentation for `--check-max-tb`. Thanks alblasco.
- Minor internal cleanup - removed some debug code.

2.1.1

Modified

- `check.call_on_fail(func)` - ***Experimental***
- *Experimental feature - may change with any release, even a minor release*
- Name changed from `check.set_failure_callback(func)`.
- Also, I warned you I could change that at any time.
- No tomatoes thrown, please.
- It's better, right? Thanks to Hynek for the suggestion.

2.1.0

Added

- `check.set_failure_callback(func)` - ***Experimental***
- *Experimental feature - may change with any release, even a minor release*
- Function to allow a callback function to be registered.
- This "func" function will be called for each failed check, and needs to accept a string parameter.
- Examples:
- `print` : `check.set_failure_callback(print)`
- allows stdout printing while test is running (provided `-s` is used).
- `logging.error` : `check.set_failure_callback(logging.error)`
- failure reports to logging
- See `examples/test_example_logging.py` for runnable examples

2.0.0

Added

- With the following change, the default is now pretty darn fast, and most people will not need to modify any settings to get most of the speed improvements.
- `--check-max-tb=<int>` - sets the max number of pseudo-traceback reports per test function.
- Default is 1.
- After this, error is still reported
- The error reports continue, they just won't have a traceback.
- If you set `--check-max-report`, then the reports stop at that number, with or without tracebacks.a
- `check.set_max_tb(int)` - overrides `--check-max-tb` for the test function it's called from. Value is reset after one test function.

Deprecated

- `check.set_no_tb` and `--set-no-tb` will be removed in a future release. (probably soon)
- `check.set_no_tb` is deprecated.
- For now, it internally calls `set_max_tb(0)`. See discussion below.
- `--check-no-tb` is deprecated.
- It's also short lived.
- Since `--check-max-tb` is more useful, the default for `--check-max-tb` is 1, which is already pretty fast.
And `--check-max-tb=0` has the same effect as `--check-no-tb`.

Changed

- [PR 109](https://github.com/okken/pytest-check/pull/109). Update README.md with conda install instructions. Thanks Abel Aoun.

Reason for major version bump

The default behavior has changed. Since `--check-max-tb=1` is the default, the default behavior is now:

- Show traceback for the first failure per test. (controlled by `--check-max-tb`, default is 1)
- Show error report for the remaining failures in a test. (controlled by `--check-max-report`, default is None)

Old default behavior was the same except all tracebacks would be reported.

My logic here:

- The actual error message, like `check 1 == 3`, is more useful than the traceback.
- The first traceback is still useful to point you to the test file, line number, of first failure.
- Other failures are probably close by.

If this logic doesn't hold for you, you can always set `--check-max-tb=1000` or some other large number.

1.3.0

- Most changes are related to speedup improvements.
- use `--check-no-tb --check-max-report=10` to get super zippy.
- `check.between()` added just for fun

Changed

- Rewrote `check.equal()` and other helper functions to not use assert.
- Check functions report things like `FAILURE: check 1 < 2` now.
- It used to say `FAILURE: assert 1 < 2`, but that's not really true anymore.

Added

- `--check-no-tb` - turn off tracebacks
- `--check-max-report` - limit reported failures per test function
- `--check-max-fail` - limit failures per test function
- `check.set_no_tb()` - turn off tracebacks for one test function
- `check.set_max_report()` - limit reports for one test function
- `check.set_max_fail()` - limit failures for one test function
- `check.between(b, a, c)` - check that a < b < c

Page 3 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.