Comments (9)
Yikes.
from pytest-check.
I'm able to reproduce the problem. I'll look into it. Hopefully soon.
from pytest-check.
Hmmm. just tried again and it seemed to work fine.
This is on a mac. I'll try again on a PC.
test_problem.py:
from pytest_check import check
def test_multiple_failures():
with check: assert 1 == 0
with check: assert 1 > 2
with check: assert 1 < 5 < 4
output seems right:
(pytest-check) $ pytest tests/test_problem.py
=============================== test session starts ================================
platform darwin -- Python 3.10.7, pytest-7.1.3, pluggy-1.0.0
rootdir: /Users/okken/projects/pytest-check, configfile: tox.ini
plugins: check-1.0.9
collected 1 item
tests/test_problem.py F [100%]
===================================== FAILURES =====================================
______________________________ test_multiple_failures ______________________________
FAILURE: assert 1 == 0
tests/test_problem.py:4 in test_multiple_failures() -> with check: assert 1 == 0
FAILURE: assert 1 > 2
tests/test_problem.py:5 in test_multiple_failures() -> with check: assert 1 > 2
FAILURE: assert 5 < 4
tests/test_problem.py:6 in test_multiple_failures() -> with check: assert 1 < 5 < 4
------------------------------------------------------------
Failed Checks: 3
============================= short test summary info ==============================
FAILED tests/test_problem.py::test_multiple_failures
================================ 1 failed in 0.02s =================================
from pytest-check.
Is this still a problem for you?
from pytest-check.
Can't recreate on windows either.
Closing issue
from pytest-check.
@okken I met the same problem. I tried to migrate from pytest-assume to check
macOs
python 3.8.13
pytest 7.1.2
pytest-check==1.0.10
import pytest_check as check
def test_smth():
with check: assert 2 < 1
with check: assert 3 < 2
test_smth.py:3 (test_smth)
def test_smth():
> with check: assert 2 < 1
E AttributeError: __enter__
test_smth.py:5: AttributeError
from pytest-check.
@ant1kdream I believe the import statement is incorrect.
Try changing: import pytest_check as check
to: from pytest_check import check
That should fix the problem you are seeing.
from pytest-check.
The documentation is perhaps the culprit of the confusion.
from pytest-check.
The documentation is perhaps the culprit of the confusion.
Thx!
Yes, it is. I took import from first example in docs
from pytest-check.
Related Issues (20)
- Count passed checks made with `pytest-check` HOT 5
- Feature request: own error message for showing in a short test summary info HOT 1
- Test is not marked as xfailed HOT 1
- Unclear intended minimum Python version
- Unchecked _max_tb causing TypeError: '<=' not supported between instances of 'int' and 'nonetype' HOT 7
- Feature request: Add new test outcome status ? HOT 1
- 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
- pytest check is not reporting all failures distributed across multiple python functions or setup fixture called within a test function HOT 3
- 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
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.