Code Monkey home page Code Monkey logo

Comments (9)

okken avatar okken commented on May 26, 2024

Yikes.

from pytest-check.

okken avatar okken commented on May 26, 2024

I'm able to reproduce the problem. I'll look into it. Hopefully soon.

from pytest-check.

okken avatar okken commented on May 26, 2024

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.

okken avatar okken commented on May 26, 2024

Is this still a problem for you?

from pytest-check.

okken avatar okken commented on May 26, 2024

Can't recreate on windows either.
Closing issue

from pytest-check.

ant1kdream avatar ant1kdream commented on May 26, 2024

@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.

okken avatar okken commented on May 26, 2024

@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.

okken avatar okken commented on May 26, 2024

The documentation is perhaps the culprit of the confusion.

from pytest-check.

ant1kdream avatar ant1kdream commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.