Skip to content

Activate coverage earlier when not in xdist #2

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
wants to merge 1 commit into from

Conversation

lahwran
Copy link

@lahwran lahwran commented Apr 21, 2014

This appears to pass the tests, as they are; I did not test under xdist, however, so it could be horribly broken (though I doubt it's more broken than a typo's worth). This does work for my application, which is a single-process run.

@schlamar
Copy link
Contributor

Yes, it fails with xdist:

AttributeError: 'Config' object has no attribute 'options'

(see Travis output).

"""Activate coverage plugin if appropriate."""
exists = getattr(early_config, "known_args_namespace", None) is not None
if not exists: # pragma: no cover
# this if is a hacky thing for versions of pytest that do not include
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should just wait for pytest 2.6 release and then depend on it.

@schlamar
Copy link
Contributor

I have a working solution for central and xdist tests. So I'm closing this in favor of #4. But there is still some work to do if you want to jump in.

@schlamar schlamar closed this Apr 23, 2014
cclauss added a commit to cclauss/pytest-cov that referenced this pull request Feb 19, 2023
# This is the 1st commit message:

Add Python 3.11 and PyPy 3.9 to the testing
# The commit message pytest-dev#2 will be skipped:

# tox.ini: Add py311 and pypy39

# The commit message pytest-dev#3 will be skipped:

# pytest72

# The commit message pytest-dev#4 will be skipped:

# xdist302
#
# Co-authored-by: Mason Lin <[email protected]>

# The commit message pytest-dev#5 will be skipped:

# coverage65
#
# Co-authored-by: Mason Lin <[email protected]>

# The commit message pytest-dev#6 will be skipped:

# Drop py36 and upgrade to pytest-xdist==3.1.0
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

Successfully merging this pull request may close these issues.

2 participants