Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
068ce3d
ci: Travis: revisit/fix coverage reporting
blueyed Feb 27, 2019
45d6663
Azure: no coverage
blueyed Feb 27, 2019
2cd9faa
Azure: use xdist with py34,py35,py36
blueyed Feb 27, 2019
bdbe13f
TEMP: Travis: only coverage jobs
blueyed Feb 27, 2019
6e07279
TEMP: Azure: only single non-coverage job
blueyed Feb 27, 2019
0af34ab
azure: py37-xdist with coverage
blueyed Feb 27, 2019
17d2943
py27-xdist via Azure
blueyed Feb 27, 2019
b22de71
TODO/mark (un)covered code
blueyed Feb 27, 2019
e03b552
Azure: coverage with py35-xdist
blueyed Feb 27, 2019
4197252
test_pdb_interaction_on_internal_error: pragma: no branch
blueyed Feb 27, 2019
7359606
Travis: py37-pexpect-xdist for coverage of flush
blueyed Feb 27, 2019
014f7b2
Travis: baseline: use TOXENV=py37-pexpect-xdist
blueyed Feb 27, 2019
8cd8314
Travis: PYTEST_ADDOPTS=-vv
blueyed Feb 27, 2019
722d41a
TOXENV=py37-xdist PYTEST_COVERAGE=1 with osx again
blueyed Feb 27, 2019
9957183
ignore branch coverage with flush
blueyed Feb 27, 2019
0598a8c
Revert: Travis: PYTEST_ADDOPTS=-vv
blueyed Feb 27, 2019
167e36c
TODO: non-empty sys.warnoptions not covered
blueyed Feb 27, 2019
359c47b
Azure: py35-lsof-xdist for coverage of lsof testing code
blueyed Feb 27, 2019
8293f3f
Travis: add env: TOXENV=py27-pexpect,py27-trial,py27-numpy PYTEST_COV…
blueyed Feb 28, 2019
e415e3b
fixup! Travis: add env: TOXENV=py27-pexpect,py27-trial,py27-numpy PYT…
blueyed Feb 28, 2019
b390115
Revert "Azure: py35-lsof-xdist for coverage of lsof testing code"
blueyed Feb 28, 2019
a850cd9
Travis: TOXENV=py27-lsof-nobyte
blueyed Feb 28, 2019
ac84f5d
fixup! fixup! Travis: add env: TOXENV=py27-pexpect,py27-trial,py27-nu…
blueyed Feb 28, 2019
62ea39f
Azure: coverage with py27 without xdist
blueyed Feb 28, 2019
56358d9
Azure: py36-xdist for _py36_windowsconsoleio_workaround
blueyed Feb 28, 2019
428e30b
Revert "ignore branch coverage with flush"
blueyed Feb 28, 2019
75e88bc
TODO
blueyed Feb 28, 2019
4361b3c
Azure: py34-xdist
blueyed Feb 28, 2019
0e4b355
Revert "Travis: TOXENV=py27-lsof-nobyte"
blueyed Feb 28, 2019
ef569a9
Azure: py27-nobyte
blueyed Feb 28, 2019
f9f4614
doc
blueyed Feb 28, 2019
dd81bde
Travis: remove py27-nobyte - covered by Azure
blueyed Feb 28, 2019
67cc480
Azure: use existing py27-numpy/nobyte
blueyed Feb 28, 2019
699f3fc
fixup! Azure: py34-xdist
blueyed Feb 28, 2019
8867164
Bring back non-coverage jobs
blueyed Feb 28, 2019
13dde1a
TEMP: only coverage jobs
blueyed Feb 28, 2019
a4d82c1
TODO: check py27-trial
blueyed Feb 28, 2019
3d0ef12
Merge branch 'master' into revisit-cov
blueyed Mar 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 6 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,8 @@ install:
- python -m pip install --upgrade --pre tox
env:
matrix:
- TOXENV=py27 PYTEST_COVERAGE=1
# Specialized factors for py27.
- TOXENV=py27-nobyte PYTEST_COVERAGE=1
- TOXENV=py27-xdist PYTEST_COVERAGE=1
- TOXENV=py27-pluggymaster-xdist
# Specialized factors for py37.
- TOXENV=py37-pexpect,py37-trial,py37-numpy
- TOXENV=py37-pluggymaster-xdist
- TOXENV=py37-freeze

matrix:
allow_failures:
Expand All @@ -29,46 +22,23 @@ matrix:

jobs:
include:
# Coverage tracking is slow with pypy, skip it.
- env: TOXENV=pypy-xdist
python: 'pypy2.7-6.0'
- env: TOXENV=pypy3-xdist
python: 'pypy3.5-6.0'

- env: TOXENV=py34-xdist
python: '3.4'
- env: TOXENV=py35-xdist
python: '3.5'
- env: TOXENV=py36-xdist
python: '3.6'
- env: TOXENV=py37
- &test-macos
os: osx
osx_image: xcode10.1
language: generic
before_install:
- python -V
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 27
env: TOXENV=py27-xdist
- <<: *test-macos
env: TOXENV=py37-xdist
env: TOXENV=py37-xdist PYTEST_COVERAGE=1
before_install:
- which python3
- python3 -V
- ln -sfn "$(which python3)" /usr/local/bin/python
- python -V
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 37

# Jobs only run via Travis cron jobs (currently daily).
- env: TOXENV=py38-xdist
python: '3.8-dev'
if: type = cron

- stage: baseline
env: TOXENV=py27-pexpect,py27-trial,py27-numpy
- env: TOXENV=py37-xdist
- env: TOXENV=linting,docs,doctesting
python: '3.7'
# Coverage for:
# - pdb / _test_pytest_function ?!
# Regressed in e3eb26f.
# But I've expected it to come via py37-pexpect already. TODO: Verify!
- env: TOXENV=py27-pexpect,py27-trial,py27-numpy PYTEST_COVERAGE=1

- stage: deploy
python: '3.6'
Expand Down
57 changes: 18 additions & 39 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,60 +17,39 @@ jobs:
vmImage: "vs2017-win2016"
strategy:
matrix:
py27:
python.version: '2.7'
tox.env: 'py27'
PYTEST_COVERAGE: '1'
py27-xdist:
python.version: '2.7'
tox.env: 'py27-xdist'
PYTEST_COVERAGE: '1'
py27-numpy/nobyte:
python.version: '2.7'
tox.env: 'py27-numpy,py27-nobyte'
# Coverage for:
# - test_supports_breakpoint_module_global
# - test_terminal_reporter_writer_attr (without xdist)
# - "if write" branch in _pytest.assertion.rewrite
# - also for more stable(?) isatty in _pytest.terminal
# (according to https://codecov.io/gh/pytest-dev/pytest/pull/4858/src/src/_pytest/terminal.py).
PYTEST_COVERAGE: '1'
py27-trial:
python.version: '2.7'
tox.env: 'py27-trial'
python.needs_vc: True
# TODO: check if coverage is necessary/useful here.
PYTEST_COVERAGE: '1'
py27-pluggymaster-xdist:
python.version: '2.7'
tox.env: 'py27-pluggymaster-xdist'
pypy:
python.version: 'pypy'
tox.env: 'pypy'
python.exe: 'pypy'
py34:
py34-xdist:
python.version: '3.4'
tox.env: 'py34'
tox.env: 'py34-xdist'
# Coverage for:
# - _pytest.compat._bytes_to_ascii
PYTEST_COVERAGE: '1'
py35:
py35-xdist:
python.version: '3.5'
tox.env: 'py35'
tox.env: 'py35-xdist'
# Coverage for test_supports_breakpoint_module_global
PYTEST_COVERAGE: '1'
py36:
py36-xdist:
python.version: '3.6'
tox.env: 'py36'
PYTEST_COVERAGE: '1'
py37:
python.version: '3.7'
tox.env: 'py37'
PYTEST_COVERAGE: '1'
py37-linting/docs/doctesting:
python.version: '3.7'
tox.env: 'linting,docs,doctesting'
py37-xdist:
python.version: '3.7'
tox.env: 'py37-xdist'
PYTEST_COVERAGE: '1'
py37-trial/numpy:
python.version: '3.7'
tox.env: 'py37-trial,py37-numpy'
tox.env: 'py36-xdist'
# Coverage for:
# - _py36_windowsconsoleio_workaround (could also be py36+)
PYTEST_COVERAGE: '1'
py37-pluggymaster-xdist:
python.version: '3.7'
tox.env: 'py37-pluggymaster-xdist'
maxParallel: 10

steps:
Expand Down
3 changes: 3 additions & 0 deletions src/_pytest/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,14 @@ def _translate_non_printable(s):

if PY35:

# TODO: only this is covered, but we have py37-xdist (osx)?!
# Might be good now via py36-xdist (linux).
def _bytes_to_ascii(val):
return val.decode("ascii", "backslashreplace")

else:

# TODO: should get covered.
def _bytes_to_ascii(val):
if val:
# source: http://goo.gl/bGsnwC
Expand Down
5 changes: 4 additions & 1 deletion src/_pytest/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,11 @@ def _width_of_current_line(self):
return self._tw.chars_on_current_line

def pytest_collection(self):
# TODO: should be covered now
if self.isatty:
if self.config.option.verbose >= 0:
if (
self.config.option.verbose >= 0
): # TODO: should be covered (true branch only)
self.write("collecting ... ", bold=True)
self._collect_report_last_write = time.time()
elif self.config.option.verbose >= 1:
Expand Down
1 change: 1 addition & 0 deletions src/_pytest/unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def runtest(self):
if self.config.pluginmanager.get_plugin("pdbinvoke") is None:
self._testcase(result=self)
else:
# TODO: should be covered now
# disables tearDown and cleanups for post mortem debugging (see #1890)
if self._handle_skip():
return
Expand Down
2 changes: 2 additions & 0 deletions src/_pytest/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def catch_warnings_for_item(config, ihook, when, item):
inifilters = config.getini("filterwarnings")
with warnings.catch_warnings(record=True) as log:

# TODO: the False branch is not covered anymore, but was still in 9dcd6f2a.
# I could not find where `python -W` would be run from.
if not sys.warnoptions:
# if user is not explicitly configuring warning filters, show deprecation warnings by default (#2908)
warnings.filterwarnings("always", category=DeprecationWarning)
Expand Down
17 changes: 7 additions & 10 deletions testing/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def test_func():

@staticmethod
def flush(child):
# TODO: should be covered now
if platform.system() == "Darwin":
return
if child.isalive():
Expand Down Expand Up @@ -322,16 +323,12 @@ def pytest_runtest_protocol():
child.expect("Pdb")

# INTERNALERROR is only displayed once via terminal reporter.
assert (
len(
[
x
for x in child.before.decode().splitlines()
if x.startswith("INTERNALERROR> Traceback")
]
)
== 1
)
error_lines = [
x
for x in child.before.decode().splitlines()
if x.startswith("INTERNALERROR> Traceback")
] # pragma: no branch
assert len(error_lines) == 1

child.sendeof()
self.flush(child)
Expand Down