call site 10 for path.local.dirpath
doc/test_conftest.py - line 19
8
9
10
11
12
13
14
15
16
17
18
19
20
21
   def test_doctest_extra_exec(): 
       # XXX get rid of the next line: 
       py.magic.autopath().dirpath('conftest.py').copy(tmpdir.join('conftest.py'))
       xtxt = tmpdir.join('y.txt')
       xtxt.write(py.code.Source("""
           hello::
               .. >>> raise ValueError 
                  >>> None
       """))
       config = py.test.config._reparse([xtxt]) 
       session = config.initsession()
->     session.main()
       l = session.getitemoutcomepairs(Failed) 
       assert len(l) == 1
test/session.py - line 57
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
   def main(self): 
       """ main loop for running tests. """
->     colitems = self.config.getcolitems()
       try:
           self.header(colitems) 
           try:
               try:
                   for colitem in colitems: 
                       self.runtraced(colitem)
               except KeyboardInterrupt: 
                   raise 
           finally: 
               self.footer(colitems) 
       except Exit, ex:
           pass
       return self.getitemoutcomepairs(Failed)
test/config.py - line 65
62
63
64
65
   def getcolitems(self):
       """ return initial collectors. """
       trails = getattr(self, '_coltrails', None)
->     return [self._getcollector(path) for path in (trails or self.args)]
test/config.py - line 75
67
68
69
70
71
72
73
74
75
76
77
   def _getcollector(self, path):
       if isinstance(path, tuple):
           relpath, names = path
           fspath = self.topdir.join(relpath)
           col = self._getcollector(fspath)
       else:
           path = py.path.local(path)
           assert path.check(), "%s: path does not exist" %(path,)
->         col = self._getrootcollector(path)
           names = path.relto(col.fspath).split(path.sep)
       return col._getitembynames(names)
test/config.py - line 80
79
80
81
82
83
84
85
   def _getrootcollector(self, path):
->     pkgpath = path.pypkgpath()
       if pkgpath is None:
           pkgpath = path.check(file=1) and path.dirpath() or path
       col = self._conftest.rget("Directory", pkgpath)(pkgpath)
       col._config = self
       return col 
path/local/local.py - line 363
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
   def pypkgpath(self, pkgname=None):
       """ return the path's package path by looking for the given
               pkgname.  If pkgname is None then look for the last
               directory upwards which still contains an __init__.py.
               Return None if a pkgpath can not be determined.
           """
       pkgpath = None
->     for parent in self.parts(reverse=True):
           if pkgname is None:
               if parent.check(file=1):
                   continue
               if parent.join('__init__.py').check():
                   pkgpath = parent
                   continue
               return pkgpath
           else:
               if parent.basename == pkgname:
                   return parent
       return pkgpath
path/common.py - line 157
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
   def parts(self, reverse=False):
       """ return a root-first list of all ancestor directories
               plus the path itself.
           """
       current = self
       l = [self]
       while 1:
           last = current
->         current = current.dirpath()
           if last == current:
               break
           l.insert(0, current)
       if reverse:
           l.reverse()
       return l