Comments (3)
Weird. I’ll take a look.
from pytest-check.
I'm not able to reproduce the problem.
It looks like it's working to me.
test_check.py
import pytest
from pytest_check import check
def a():
check.equal(1, 1)
check.equal(1, 2, msg='a failure 1')
check.equal(1, 3, msg='a failure 2')
def b():
check.equal(1, 1)
check.equal(1, 2, msg='a failure 1, total 3')
check.equal(1, 3, msg='b failure 2, total 4')
check.equal(1, 4, msg='c failure 3, total 5')
def c():
check.equal(1, 1)
check.equal(1, 2, msg='c failure 1, total 6')
check.equal(1, 3, msg='c failure 2, total 7')
@pytest.fixture()
def a_fixture():
yield
# failure in teardown
check.equal(1, 1)
check.equal(1, 2, msg='fixture failure 1, total 8')
check.equal(1, 3, msg='fixture failure 2, total 9')
def test_(a_fixture):
a()
b()
c()
It's a little confusing because the teardown failures cause an ERROR and pytest reports errors separately from failures.
Also the errors are reported first.
But still, I see 7 errors in test, and 2 in the fixture.
$ pytest test_check.py
============================= test session starts =============================
collected 1 item
test_check.py FE [100%]
=================================== ERRORS ====================================
_________________________ ERROR at teardown of test_ __________________________
FAILURE: check 1 == 2: fixture failure 1, total 8
test_check.py:26 in a_fixture() -> check.equal(1, 2, msg='fixture failure 1, total 8')
FAILURE: check 1 == 3: fixture failure 2, total 9
------------------------------------------------------------
Failed Checks: 2
================================== FAILURES ===================================
____________________________________ test_ ____________________________________
FAILURE: check 1 == 2: a failure 1
test_check.py:31 in test_() -> a()
test_check.py:6 in a() -> check.equal(1, 2, msg='a failure 1')
FAILURE: check 1 == 3: a failure 2
FAILURE: check 1 == 2: a failure 1, total 3
FAILURE: check 1 == 3: b failure 2, total 4
FAILURE: check 1 == 4: c failure 3, total 5
FAILURE: check 1 == 2: c failure 1, total 6
FAILURE: check 1 == 3: c failure 2, total 7
------------------------------------------------------------
Failed Checks: 7
=========================== short test summary info ===========================
FAILED test_check.py::test_
ERROR test_check.py::test_
========================= 1 failed, 1 error in 0.19s ==========================
from pytest-check.
If you've got a failure example, please share, and I can re-open the issue.
from pytest-check.
Related Issues (20)
- Test is not marked as xfailed when pytest.xfail() called after a failure. HOT 2
- RFE: is it possible to start making github releases?🤔 HOT 6
- Linux environment does not have version 2.1.5 HOT 3
- Document & test: custom error message for check.raises HOT 2
- raises match argument HOT 1
- Is the 'raises' parameter in xfail ignored? HOT 1
- `pytest-check` causes `pytest-xdist` testing to fail HOT 1
- Add new check type: match - use regular expressions to tests againgst a string HOT 1
- pytest_html HOT 1
- How to have all failure on logging pytestfile HOT 1
- [v2.2.3] ExceptionRepr creation is not compatible with pytest < 7.3. HOT 2
- INTERNALERROR after upgrading package to 2.2.3 or 2.2.4 version HOT 5
- Add an xdist test
- Incorrect arguments to `ExceptionRepr` HOT 5
- d7afe0d6570c24d8d9ecc4443be9a765a0b85c2c HOT 1
- d7afe0d6570c24d8d9ecc4443be9a765a0b85c2c
- type-hinting the project
- Include a `check.match` and `check.not_match` for regex comparison HOT 1
- Linux environment can only download and install libraries up to version 2.1.5 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-check.