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

[4.6] tests: restore tracing function #5408

Merged

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Jun 5, 2019

Without this, testing/test_pdb.py (already without pexpect) will cause
missing test coverage afterwards (for the same process).

Without this, `testing/test_pdb.py` (already without pexpect) will cause
missing test coverage afterwards (for the same process).
@codecov
Copy link

codecov bot commented Jun 5, 2019

Codecov Report

Merging #5408 into 4.6-maintenance will increase coverage by 1.74%.
The diff coverage is 57.14%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           4.6-maintenance    #5408      +/-   ##
===================================================
+ Coverage            94.43%   96.18%   +1.74%     
===================================================
  Files                  115      115              
  Lines                26384    26391       +7     
  Branches              2603     2605       +2     
===================================================
+ Hits                 24916    25383     +467     
+ Misses                1143      703     -440     
+ Partials               325      305      -20
Impacted Files Coverage Δ
testing/conftest.py 90.32% <57.14%> (-9.68%) ⬇️
src/_pytest/main.py 96.28% <0%> (+0.21%) ⬆️
src/_pytest/fixtures.py 97.55% <0%> (+0.27%) ⬆️
testing/test_capture.py 99.25% <0%> (+0.29%) ⬆️
testing/test_terminal.py 99.84% <0%> (+0.31%) ⬆️
testing/test_config.py 99.83% <0%> (+0.33%) ⬆️
testing/python/collect.py 99.36% <0%> (+0.42%) ⬆️
src/_pytest/assertion/rewrite.py 95.77% <0%> (+0.48%) ⬆️
testing/python/fixtures.py 99.09% <0%> (+0.56%) ⬆️
src/_pytest/junitxml.py 95.9% <0%> (+0.58%) ⬆️
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 21680ff...1b7597a. Read the comment docs.

import pytest

if sys.gettrace():
Copy link
Member

Choose a reason for hiding this comment

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

hmmm I would have put this in the function and orig_trace is not None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, this way it avoids using the fixture when not run with coverage (i.e. no initial tracing).
(not sure I understand your suggestion though)

Copy link
Member

Choose a reason for hiding this comment

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

I agree it seems better to not have this active without need.

import pytest

if sys.gettrace():
Copy link
Member

Choose a reason for hiding this comment

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

I agree it seems better to not have this active without need.

@nicoddemus
Copy link
Member

I will go ahead and merge this as the original PR is already on master. 👍

@nicoddemus nicoddemus merged commit 1cae76b into pytest-dev:4.6-maintenance Jun 5, 2019
@blueyed blueyed deleted the backport-coverage-fix branch June 6, 2019 12:18
@blueyed
Copy link
Contributor Author

blueyed commented Jun 6, 2019

I will go ahead and merge this as the original PR is already on master. 

Thanks. We can still improve/change it though (possibly without a backport), if @asottile would like to have it.

@nicoddemus
Copy link
Member

We can still improve/change it though (possibly without a backport), if @asottile would like to have it.

Definitely!

I just went ahead with the merge because IMO we should try to make the backports as close to the original as possible. Improvements suggested during the backport PR should happen in another round of PRs if they apply to the original patch.

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.

None yet

3 participants