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

Version 4.6.0 skips tests without apparent reason #5354

Closed
Snawoot opened this issue Jun 1, 2019 · 8 comments

Comments

Projects
None yet
3 participants
@Snawoot
Copy link

commented Jun 1, 2019

Since version 4.6.0 pytest skips tests without apparent reason: https://travis-ci.org/Snawoot/postfix-mta-sts-resolver/jobs/540181138

  • output of pip list from the virtual environment you are using: HERE
  • pytest and operating system versions: pytest 4.6.0 on Ubuntu Xenial @ Travis CI
  • minimal example if possible: link above

I can't understand why it happens, so I had to immediately rollback to 4.5.0 and fix this version in dev dependencies.

@asottile

This comment has been minimized.

Copy link
Member

commented Jun 1, 2019

Can you add -rs (it should add additional reporting information about skipped tests)

@asottile asottile added the type: bug label Jun 1, 2019

@asottile

This comment has been minimized.

Copy link
Member

commented Jun 1, 2019

This appears to be the minimal case to reproduce this:

import itertools

import pytest

AS = (1, 2, 3)
BS = (4, 5, 6)


@pytest.mark.parametrize(('a', 'b'), itertools.product(AS, BS))
def test(a, b):
    pass

A workaround is to apply this diff:

-@pytest.mark.parametrize(('a', 'b'), itertools.product(AS, BS))
+@pytest.mark.parametrize(('a', 'b'), tuple(itertools.product(AS, BS)))

looking now to see what regressed this 🤔

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Member

commented Jun 1, 2019

There should be a warning

@asottile

This comment has been minimized.

Copy link
Member

commented Jun 1, 2019

w/ -rs it produces this:

$ pytest t.py -rs
============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-4.6.0, py-1.8.0, pluggy-0.12.0
rootdir: /home/asottile/workspace/pyupgrade
collected 1 item                                                               

t.py s                                                                   [100%]

=========================== short test summary info ============================
SKIPPED [1] t.py:9: got empty parameter set ('a', 'b'), function test at /home/asottile/workspace/pyupgrade/t.py:8
========================== 1 skipped in 0.01 seconds ===========================
@asottile

This comment has been minimized.

Copy link
Member

commented Jun 1, 2019

Looks like this regressed in #5254 CC @Sup3rGeo

@Snawoot

This comment has been minimized.

Copy link
Author

commented Jun 1, 2019

@asottile Thank you! Workaround does just fine. Here is output with -rs option if still needed: https://travis-ci.org/Snawoot/postfix-mta-sts-resolver/jobs/540200985

@asottile

This comment has been minimized.

Copy link
Member

commented Jun 1, 2019

#5356 has a fix for this -- thanks for the issue! 🎉

@Snawoot Snawoot referenced this issue Jun 1, 2019

Merged

Improve coverage #37

jwodder added a commit to jwodder/pyrepo that referenced this issue Jun 2, 2019

@asottile

This comment has been minimized.

Copy link
Member

commented Jun 2, 2019

This has been released as part of 4.6.1 -- thanks again for the report!

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.