Skip to content

CI job "py27-pytestlatest-xdist" fails #276

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

Closed
youtux opened this issue Nov 25, 2018 · 2 comments
Closed

CI job "py27-pytestlatest-xdist" fails #276

youtux opened this issue Nov 25, 2018 · 2 comments

Comments

@youtux
Copy link
Contributor

youtux commented Nov 25, 2018

The job is failing lately, and this can be reproduced (without using xdist) using this particular schedule:

$ tests/feature/test_no_sctrict_gherkin.py::test_background_no_strict_gherkin  tests/feature/test_wrong.py::test_verbose_output

It seems that the setup of test_background_no_strict_gherkin leaks into test_verbose_output. I think this is a pytest issue and I am trying to create a smaller file to reproduce the issue.

@sliwinski-milosz
Copy link
Contributor

Good spot!

The problem here is with pytest.config which keeps using config loaded from testdir during test_background_no_strict_gherkin.

While running test_verbose_output:

(Pdb) pytest.config.inifile
local('/private/var/folders/f3/5s577s4x3ln6fb9g8t4kxbn40000gn/T/pytest-of-milosz.sliwinski/pytest-222/test_background_no_strict_gherkin0/tox.ini')

So solution would be to do the setup for test_background_no_strict_gherkin but then also teardown and bring back the config from before test.

But anyway as we rely on pytest.config which is global variable it is not thread safe.

Maybe we could add something like this:

@pytest.fixture(autouse=True)
def config_reset():
    # setup
    # save default config
    yield
    # teardown
    # load default config

@youtux
Copy link
Contributor Author

youtux commented Dec 2, 2018

It turns out to be a bug in pytest: pytest-dev/pytest#4495 (comment)

sliwinski-milosz added a commit to sliwinski-milosz/pytest-bdd that referenced this issue Dec 8, 2018
…bprocess to not mess with pytest internal state
sliwinski-milosz added a commit to sliwinski-milosz/pytest-bdd that referenced this issue Dec 8, 2018
…bprocess to not mess with pytest internal state
sliwinski-milosz added a commit to sliwinski-milosz/pytest-bdd that referenced this issue Dec 8, 2018
… tests separation. Do not use deprecated pytest.config global variable
@youtux youtux closed this as completed in 216bead Feb 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants