All notable changes to this project be documented in this file.
is_nan()
is_not_nan()
- Drop Python 3.7
- Add testing for Python 3.12
- Add tox-uv to tox.ini and main.yml
- Documentation Update, README.md
- Turn help function list into a table with param lists
- Show an alternative method of creating a helper function using
check.fail()
between_equal(b, a c)
- as a shortcut for
between(b, a, c, ge=True, le=True)
- as a shortcut for
fail(msg)
- indicate test failure, but don't stop testing
- fix 155
- Summaries from 2.2.3 are cool, but don't work with xdist
- Turn off summaries while xdist is running
- I hope I'm not seeing a pattern here
- fix 153
- Summaries from 2.2.3 are cool, but don't work for pytest < 7.3
- Remove them for earlier pytest
- Add tox test run for pytest 7.0.0
- Change dependencies to require 7.0.0 pytest
- Check failure info now shows up in summaries.
- fix 133 - thanks hirotoKirimaru
- Fix 137
- Increase Python range to include 3.7.0. Thanks EliahKagan
- pseudo traceback additions
-l
or--showlocals
shows locals__tracebackhide__ = True
is honored.- if
assert
or other exception is involved,- the exception is included as part of the traceback.
- pseudo traceback changes
- The red color is used more selectively.
- this is intended to help readability
- Other minor formatting changes.
- Please let me know if you have any issues with the changes
- include tests an examples in sdist - pr 121
- publish-to-pypi.yml workflow
- README.md - clean up documentation for
--check-max-tb
. Thanks alblasco. - Minor internal cleanup - removed some debug code.
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.
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).
- allows stdout printing while test is running (provided
logging.error
:check.set_failure_callback(logging.error)
- failure reports to logging
- See
examples/test_example_logging.py
for runnable examples
- 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.
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.
- For now, it internally calls
--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
.
- PR 109. Update README.md with conda install instructions. Thanks Abel Aoun.
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.
- Most changes are related to speedup improvements.
- use
--check-no-tb --check-max-report=10
to get super zippy.
- use
check.between()
added just for fun
- 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.
- It used to say
--check-no-tb
- turn off tracebacks--check-max-report
- limit reported failures per test function--check-max-fail
- limit failures per test functioncheck.set_no_tb()
- turn off tracebacks for one test functioncheck.set_max_report()
- limit reports for one test functioncheck.set_max_fail()
- limit failures for one test functioncheck.between(b, a, c)
- check that a < b < c
-
Remove colorama as a dependency, and simplify how we do "red".
-
Change the formatting of context manager checks such that if a msg is included, we see both the message and the assert failure. Previoulsy, the message would replace the assert failure.
- Add
any_failures()
. Thank you @alblasco
- While using the
check
fixture, allowcheck.check
as a context manager.- this is unnecessary, the
check
fixture now works as a context manager. - but apparently some people have been using
with check.check:
- so this fix makes that work.
- this is unnecessary, the
- Allow
raises
fromcheck
object.- Now
with check.raises(Exception):
works.
- Now
- README update
- Red output in pseudo-traceback
- Refactored code into more modules
- All functionality now possible through
check
fixture orfrom pytest_check import check
.- The
check
object from either of these methods can be used as either a context manager or to access the check helper functions.
- The
- Lots of rewrite in README
- API change.
- Access to check helper functions via
import pytest_check as check
is deprecated. - It still works, but will be removed in a future version.
- However, there is no deprecation warning for this.
- Access to check helper functions via
- issue 80 --tb=no should remove tracebacks from xml output
- issue 55 a problem with multiple drive letters.
- Support check failures not blowing up if called outside of a test.
- changelog.md format. :)
- tox.ini cleanup
- refactoring tests to use examples directory instead of embedding example tests in test code.
- this is easier to understand and debug issues.
- also provides extra documentation through examples directory
- Handle cases when context is None
- Update pyproject.toml to use newer flit
- Changed plugin name from pytest_check to pytest-check.
- Add
raises
- Require Python >= 3.6
- Remove old Manifest.in file.
- Fix #64, modifications to maxfail behavior.
- Add
excinfo
to call object inpytest_runtest_makereport()
.- Intended to help with some report systems.
- Remove Beta Classifier
- Status is now "Development Status :: 5 - Production/Stable"
- Jump to 1.0 version, API is fairly stable.
- Fix #43/#44 tests with failing checks and failing asserts now report all issues.
- added
is_()
andis_not()
- Requires pytest 6.0 or above. (Removed some cruft to support pytest 5.x)