Skip to content

Commit 4e45472

Browse files
committed
Merge master into features
Conflicts: src/_pytest/debugging.py
2 parents 92b436c + 5f9db8a commit 4e45472

File tree

18 files changed

+79
-36
lines changed

18 files changed

+79
-36
lines changed

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- env: TOXENV=py37-freeze
6161

6262
- env: TOXENV=py38-xdist
63-
python: '3.8-dev'
63+
python: '3.8'
6464

6565
- stage: baseline
6666
env: TOXENV=py36-xdist
@@ -94,11 +94,6 @@ jobs:
9494
tags: true
9595
repo: pytest-dev/pytest
9696

97-
matrix:
98-
allow_failures:
99-
- python: '3.8-dev'
100-
env: TOXENV=py38-xdist
101-
10297
before_script:
10398
- |
10499
# Do not (re-)upload coverage with cron runs.

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ with advance notice in the **Deprecations** section of releases.
1313
file is managed by towncrier. You *may* edit previous change logs to
1414
fix problems like typo corrections or such.
1515
To add a new change log entry, please see
16-
https://pip.pypa.io/en/latest/development/#adding-a-news-entry
16+
https://pip.pypa.io/en/latest/development/contributing/#news-entries
1717
we named the news folder changelog
1818
1919
.. towncrier release notes start

changelog/6099.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix ``--trace`` when used with parametrized functions.

src/_pytest/_code/code.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def eval(self, code, **vars):
137137
def exec_(self, code, **vars):
138138
""" exec 'code' in the frame
139139
140-
'vars' are optiona; additional local variables
140+
'vars' are optional; additional local variables
141141
"""
142142
f_locals = self.f_locals.copy()
143143
f_locals.update(vars)
@@ -207,7 +207,7 @@ def path(self):
207207

208208
@property
209209
def locals(self):
210-
""" locals of underlaying frame """
210+
""" locals of underlying frame """
211211
return self.frame.f_locals
212212

213213
def getfirstlinesource(self):
@@ -274,7 +274,7 @@ def __str__(self):
274274

275275
@property
276276
def name(self):
277-
""" co_name of underlaying code """
277+
""" co_name of underlying code """
278278
return self.frame.code.raw.co_name
279279

280280

@@ -302,7 +302,7 @@ def f(cur):
302302
def cut(self, path=None, lineno=None, firstlineno=None, excludepath=None):
303303
""" return a Traceback instance wrapping part of this Traceback
304304
305-
by provding any combination of path, lineno and firstlineno, the
305+
by providing any combination of path, lineno and firstlineno, the
306306
first frame to start the to-be-returned traceback is determined
307307
308308
this allows cutting the first part of a Traceback instance e.g.
@@ -1008,7 +1008,7 @@ def __init__(self, path, lineno, message):
10081008

10091009
def toterminal(self, tw) -> None:
10101010
# filename and lineno output for each entry,
1011-
# using an output format that most editors unterstand
1011+
# using an output format that most editors understand
10121012
msg = self.message
10131013
i = msg.find("\n")
10141014
if i != -1:

src/_pytest/assertion/util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def format_explanation(explanation: str) -> str:
3838
for when one explanation needs to span multiple lines, e.g. when
3939
displaying diffs.
4040
"""
41-
explanation = explanation
4241
lines = _split_explanation(explanation)
4342
result = _format_lines(lines)
4443
return "\n".join(result)

src/_pytest/debugging.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
""" interactive debugging with PDB, the Python Debugger. """
22
import argparse
3+
import functools
34
import sys
45

56
from _pytest import outcomes
@@ -278,13 +279,16 @@ def pytest_pyfunc_call(self, pyfuncitem):
278279
def _test_pytest_function(pyfuncitem):
279280
_pdb = pytestPDB._init_pdb("runcall")
280281
testfunction = pyfuncitem.obj
281-
pyfuncitem.obj = _pdb.runcall
282-
if "func" in pyfuncitem._fixtureinfo.argnames: # pragma: no branch
283-
raise ValueError("--trace can't be used with a fixture named func!")
284-
pyfuncitem.funcargs["func"] = testfunction
285-
new_list = list(pyfuncitem._fixtureinfo.argnames)
286-
new_list.append("func")
287-
pyfuncitem._fixtureinfo.argnames = tuple(new_list)
282+
283+
# we can't just return `partial(pdb.runcall, testfunction)` because (on
284+
# python < 3.7.4) runcall's first param is `func`, which means we'd get
285+
# an exception if one of the kwargs to testfunction was called `func`
286+
@functools.wraps(testfunction)
287+
def wrapper(*args, **kwargs):
288+
func = functools.partial(testfunction, *args, **kwargs)
289+
_pdb.runcall(func)
290+
291+
pyfuncitem.obj = wrapper
288292

289293

290294
def _enter_pdb(node, excinfo, rep):

src/_pytest/junitxml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def node_reporter(self, report):
513513
key = nodeid, slavenode
514514

515515
if key in self.node_reporters:
516-
# TODO: breasks for --dist=each
516+
# TODO: breaks for --dist=each
517517
return self.node_reporters[key]
518518

519519
reporter = _NodeReporter(nodeid, self)

src/_pytest/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def gethookproxy(self, fspath):
437437
# one or more conftests are not in use at this fspath
438438
proxy = FSHookProxy(fspath, pm, remove_mods)
439439
else:
440-
# all plugis are active for this fspath
440+
# all plugins are active for this fspath
441441
proxy = self.config.hook
442442
return proxy
443443

src/_pytest/mark/evaluate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self, item, name):
2828
self._mark_name = name
2929

3030
def __bool__(self):
31-
# dont cache here to prevent staleness
31+
# don't cache here to prevent staleness
3232
return bool(self._get_marks())
3333

3434
__nonzero__ = __bool__

src/_pytest/mark/legacy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
this is a place where we put datastructures used by legacy apis
3-
we hope ot remove
3+
we hope to remove
44
"""
55
import keyword
66

0 commit comments

Comments
 (0)