Commits

Ronny Pfannschmidt  committed d921bcd

sync pytest with the 2.2.3 release

  • Participants
  • Parent commits 97e8ddb
  • Branches pytest

Comments (0)

Files changed (5)

File _pytest/__init__.py

 #
-__version__ = '2.2.2.dev6'
+__version__ = '2.2.3'

File _pytest/main.py

         self._notfound = []
         self._initialpaths = set()
         self._initialparts = []
+        self.items = items = []
         for arg in args:
             parts = self._parsearg(arg)
             self._initialparts.append(parts)
         if not genitems:
             return rep.result
         else:
-            self.items = items = []
             if rep.passed:
                 for node in rep.result:
                     self.items.extend(self.genitems(node))

File _pytest/python.py

         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()

File _pytest/runner.py

 
 def pytest_sessionstart(session):
     session._setupstate = SetupState()
+def pytest_sessionfinish(session):
+    session._setupstate.teardown_all()
 
 class NodeInfo:
     def __init__(self, location):

File _pytest/terminal.py

         # 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 = ""