Skip to content

Conversation

@asottile
Copy link
Member

@asottile asottile commented Oct 28, 2018

Resolves #4260

For the same reasons as this it's difficult to write a future-proof regression test for this.

Here's what I used locally to verify this though:

import pytest


@pytest.mark.xfail
def test_xfail():
    assert False

def test():
    '\d'

before

$ rm -rf __pycache__/ && pytest -Wonce t.py
============================= test session starts ==============================
platform linux -- Python 3.6.6, pytest-3.9.4.dev5+ge6e40db9, py-1.7.0, pluggy-0.8.0
rootdir: /tmp/pytest, inifile: tox.ini
collected 2 items                                                              

t.py x.                                                                  [100%]
=========================== short test summary info ============================
XFAIL t.py::test_xfail

=============================== warnings summary ===============================
t.py:9
  /tmp/pytest/t.py:9: DeprecationWarning: invalid escape sequence \d
    '\d'

t.py::test_xfail
  source:9: DeprecationWarning: invalid escape sequence \d

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=============== 1 passed, 1 xfailed, 2 warnings in 0.05 seconds ================

after

$ rm -rf __pycache__/ && pytest -Wonce t.py
============================= test session starts ==============================
platform linux -- Python 3.6.6, pytest-3.9.4.dev5+ge6e40db9, py-1.7.0, pluggy-0.8.0
rootdir: /tmp/pytest, inifile: tox.ini
collected 2 items                                                              

t.py x.                                                                  [100%]
=========================== short test summary info ============================
XFAIL t.py::test_xfail

=============================== warnings summary ===============================
t.py:9
  /tmp/pytest/t.py:9: DeprecationWarning: invalid escape sequence \d
    '\d'

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=============== 1 passed, 1 xfailed, 1 warnings in 0.05 seconds ================

@codecov
Copy link

codecov bot commented Oct 29, 2018

Codecov Report

Merging #4261 into master will decrease coverage by <.01%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4261      +/-   ##
==========================================
- Coverage   95.87%   95.86%   -0.01%     
==========================================
  Files         109      109              
  Lines       24606    24608       +2     
  Branches     2394     2394              
==========================================
  Hits        23591    23591              
- Misses        720      721       +1     
- Partials      295      296       +1
Flag Coverage Δ
#docs 29.04% <83.33%> (ø) ⬆️
#doctesting 29.04% <83.33%> (ø) ⬆️
#linting 29.04% <83.33%> (ø) ⬆️
#linux 95.65% <83.33%> (-0.01%) ⬇️
#nobyte 92.02% <83.33%> (ø) ⬆️
#numpy 93.02% <83.33%> (ø) ⬆️
#pexpect 41.66% <83.33%> (ø) ⬆️
#py27 94.05% <83.33%> (ø) ⬆️
#py34 92.34% <83.33%> (+0.03%) ⬆️
#py35 92.35% <83.33%> (+0.03%) ⬆️
#py36 93.99% <83.33%> (-0.01%) ⬇️
#py37 92.37% <83.33%> (+0.03%) ⬆️
#trial 93.02% <83.33%> (ø) ⬆️
#windows 94.13% <83.33%> (-0.01%) ⬇️
#xdist 93.89% <83.33%> (-0.01%) ⬇️
Impacted Files Coverage Δ
src/_pytest/_code/source.py 90.74% <83.33%> (+0.08%) ⬆️
src/_pytest/capture.py 93.39% <0%> (-0.46%) ⬇️

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 e6e40db...207e9bb. Read the comment docs.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

LGTM, minor nits only. 👍

Copy link
Contributor

@blueyed blueyed left a comment

Choose a reason for hiding this comment

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

Travis finished successfully (https://travis-ci.org/pytest-dev/pytest/builds/447862356) despite the reported (pending) status.

@asottile asottile merged commit f258b75 into pytest-dev:master Oct 30, 2018
@asottile asottile deleted the no_anonymous_source_warning branch October 30, 2018 01:29
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.

3 participants