Pytest: Version 4.6.0 skips tests without apparent reason

Created on 1 Jun 2019  路  8Comments  路  Source: pytest-dev/pytest

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

  • [x] output of pip list from the virtual environment you are using: HERE
  • [x] pytest and operating system versions: pytest 4.6.0 on Ubuntu Xenial @ Travis CI
  • [x] 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.

bug

Most helpful comment

5356 has a fix for this -- thanks for the issue! 馃帀

All 8 comments

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

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:

[email protected](('a', 'b'), itertools.product(AS, BS))
[email protected](('a', 'b'), tuple(itertools.product(AS, BS)))

looking now to see what regressed this 馃

There should be a warning

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 ===========================

Looks like this regressed in https://github.com/pytest-dev/pytest/pull/5254 CC @Sup3rGeo

@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

5356 has a fix for this -- thanks for the issue! 馃帀

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

Was this page helpful?
0 / 5 - 0 ratings