Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behaviour for generator expressions in python 3.7 #5371

Closed
mbway opened this issue Jun 3, 2019 · 2 comments

Comments

Projects
None yet
4 participants
@mbway
Copy link

commented Jun 3, 2019

When running the following example with pytest 4.6.1 with python 3.6 from conda, the test passes, however when running with the same pytest version with python 3.7 the second assert statement fails

def test_example():
    assert all(list(x for x in [True, False] if x))
    assert all(x for x in [True, False] if x)
    def test_example():
        assert all(list(x for x in [True, False] if x))
>       assert all(x for x in [True, False] if x)
E       assert False

pytest_example.py:4: AssertionError

Conda requirements file:

name: pytest_test
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.7
  - pytest

@mbway mbway changed the title Unexpected behaviour for generator expressions in python 3 Unexpected behaviour for generator expressions in python 3.7 Jun 3, 2019

@geewrd

This comment has been minimized.

Copy link

commented Jun 3, 2019

I reproduced this exact issue with Python 3.6.8. It's failing in one environment, but working in another with the same version of python, and the same version of pytest.

@asottile

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

this has been released as part of 4.6.2 -- those that were experiencing these issues may need to clean .pyc files after upgrading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.