aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_pytest/__init__.py2
-rw-r--r--_pytest/main.py2
-rw-r--r--_pytest/python.py8
-rw-r--r--_pytest/runner.py2
-rw-r--r--_pytest/terminal.py16
5 files changed, 21 insertions, 9 deletions
diff --git a/_pytest/__init__.py b/_pytest/__init__.py
index 0a695c2035..6c2941d5d5 100644
--- a/_pytest/__init__.py
+++ b/_pytest/__init__.py
@@ -1,2 +1,2 @@
#
-__version__ = '2.2.2.dev6'
+__version__ = '2.2.3'
diff --git a/_pytest/main.py b/_pytest/main.py
index f6354205b0..7ac673cf39 100644
--- a/_pytest/main.py
+++ b/_pytest/main.py
@@ -410,6 +410,7 @@ class Session(FSCollector):
self._notfound = []
self._initialpaths = set()
self._initialparts = []
+ self.items = items = []
for arg in args:
parts = self._parsearg(arg)
self._initialparts.append(parts)
@@ -425,7 +426,6 @@ class Session(FSCollector):
if not genitems:
return rep.result
else:
- self.items = items = []
if rep.passed:
for node in rep.result:
self.items.extend(self.genitems(node))
diff --git a/_pytest/python.py b/_pytest/python.py
index 7705249846..5289fe6f50 100644
--- a/_pytest/python.py
+++ b/_pytest/python.py
@@ -629,9 +629,11 @@ class Metafunc:
if not isinstance(argnames, (tuple, list)):
argnames = (argnames,)
argvalues = [(val,) for val in argvalues]
- for arg in argnames:
- if arg not in self.funcargnames:
- raise ValueError("%r has no argument %r" %(self.function, arg))
+ if not indirect:
+ #XXX should we also check for the opposite case?
+ for arg in argnames:
+ if arg not in self.funcargnames:
+ raise ValueError("%r has no argument %r" %(self.function, arg))
valtype = indirect and "params" or "funcargs"
if not ids:
idmaker = IDMaker()
diff --git a/_pytest/runner.py b/_pytest/runner.py
index 048ca1dd9b..f9f203ffab 100644
--- a/_pytest/runner.py
+++ b/_pytest/runner.py
@@ -47,6 +47,8 @@ def pytest_terminal_summary(terminalreporter):
def pytest_sessionstart(session):
session._setupstate = SetupState()
+def pytest_sessionfinish(session):
+ session._setupstate.teardown_all()
class NodeInfo:
def __init__(self, location):
diff --git a/_pytest/terminal.py b/_pytest/terminal.py
index 5245f339bb..6446ac7064 100644
--- a/_pytest/terminal.py
+++ b/_pytest/terminal.py
@@ -282,10 +282,18 @@ class TerminalReporter:
# we take care to leave out Instances aka ()
# because later versions are going to get rid of them anyway
if self.config.option.verbose < 0:
- for item in items:
- nodeid = item.nodeid
- nodeid = nodeid.replace("::()::", "::")
- self._tw.line(nodeid)
+ if self.config.option.verbose < -1:
+ counts = {}
+ for item in items:
+ name = item.nodeid.split('::', 1)[0]
+ counts[name] = counts.get(name, 0) + 1
+ for name, count in sorted(counts.items()):
+ self._tw.line("%s: %d" % (name, count))
+ else:
+ for item in items:
+ nodeid = item.nodeid
+ nodeid = nodeid.replace("::()::", "::")
+ self._tw.line(nodeid)
return
stack = []
indent = ""