diff options
author | Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de> | 2012-02-17 12:09:37 +0100 |
---|---|---|
committer | Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de> | 2012-02-17 12:09:37 +0100 |
commit | 856d9cf06fac9366f82f998ad4caefef177f1a1e (patch) | |
tree | 18caed5a1ddb689ab3e967aa9e7f338badc337ca | |
parent | sync pylib with 1.7.4 + mattip's patch (diff) | |
download | pypy-856d9cf06fac9366f82f998ad4caefef177f1a1e.tar.gz pypy-856d9cf06fac9366f82f998ad4caefef177f1a1e.tar.bz2 pypy-856d9cf06fac9366f82f998ad4caefef177f1a1e.zip |
sync pytest with the 2.2.3 release
-rw-r--r-- | _pytest/__init__.py | 2 | ||||
-rw-r--r-- | _pytest/main.py | 2 | ||||
-rw-r--r-- | _pytest/python.py | 8 | ||||
-rw-r--r-- | _pytest/runner.py | 2 | ||||
-rw-r--r-- | _pytest/terminal.py | 16 |
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 = "" |