call site 0 for path.local.__contains__
doc/test_conftest.py - line 66
64
65
66
67
68
69
70
71
72
73
74
75
76
77
   def test_doctest_eol(): 
       # XXX get rid of the next line: 
->     py.magic.autopath().dirpath('conftest.py').copy(tmpdir.join('conftest.py'))
   
       ytxt = tmpdir.join('y.txt')
       ytxt.write(py.code.Source(".. >>> 1 + 1\r\n   2\r\n\r\n"))
       config = py.test.config._reparse([ytxt]) 
       session = config.initsession()
       session.main()
       l = session.getitemoutcomepairs(Failed)
       assert len(l) == 0 
       l = session.getitemoutcomepairs(Passed)
       l2 = session.getitemoutcomepairs(Skipped)
       assert len(l+l2) == 2
magic/autopath.py - line 32
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
   def autopath(globs=None, basefile='__init__.py'):
       """ return the (local) path of the "current" file pointed to by globals
           or - if it is none - alternatively the callers frame globals.
   
           the path will always point to a .py file  or to None.
           the path will have the following payload:
           pkgdir   is the last parent directory path containing 'basefile'
                    starting backwards from the current file.
       """
       if globs is None:
           globs = sys._getframe(1).f_globals
       try:
           __file__ = globs['__file__']
       except KeyError:
           if not sys.argv[0]:
               raise ValueError, "cannot compute autopath in interactive mode"
           __file__ = os.path.abspath(sys.argv[0])
   
       custom__file__ = isinstance(__file__, PathStr)
       if custom__file__:
           ret = __file__.__path__
       else:
           ret = local(__file__)
           if ret.ext in ('.pyc', '.pyo'):
               ret = ret.new(ext='.py')
       current = pkgdir = ret.dirpath()
       while 1:
->         if basefile in current:
               pkgdir = current
               current = current.dirpath()
               if pkgdir != current:
                   continue
           elif not custom__file__ and str(current) not in sys.path:
               sys.path.insert(0, str(current))
           break
       ret.pkgdir = pkgdir
       return ret