call site 0 for path.local.stat
doc/test_conftest.py - line 17
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/config.py - line 187
180
181
182
183
184
185
186
187
188
189
190
   def _reparse(self, args):
       """ this is used from tests that want to re-invoke parse(). """
       #assert args # XXX should not be empty
       global config_per_process
       oldconfig = py.test.config
       try:
           config_per_process = py.test.config = Config()
->         config_per_process.parse(args) 
           return config_per_process
       finally: 
           config_per_process = py.test.config = oldconfig 
test/config.py - line 46
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
   def parse(self, args): 
       """ parse cmdline arguments into this config object. 
               Note that this can only be called once per testing process. 
           """ 
       assert not self._initialized, (
               "can only parse cmdline args once per Config object")
       self._initialized = True
       adddefaultoptions(self)
->     self._conftest.setinitial(args) 
       args = [str(x) for x in args]
       cmdlineoption, args = self._parser.parse_args(args) 
       self.option.__dict__.update(vars(cmdlineoption))
       if not args:
           args.append(py.std.os.getcwd())
       self.topdir = gettopdir(args)
       self.args = args 
test/conftesthandle.py - line 32
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
   def setinitial(self, args):
       """ return a Conftest object initialized with a path obtained
               from looking at the first (usually cmdline) argument that points
               to an existing file object. 
               XXX note: conftest files may add command line options
               and we thus have no completely safe way of determining
               which parts of the arguments are actually related to options. 
           """
       current = py.path.local()
       for arg in args + [current]:
           anchor = current.join(arg, abs=1)
           if anchor.check(): # we found some file object 
               #print >>py.std.sys.stderr, "initializing conftest from", anchor
               # conftest-lookups without a path actually mean 
               # lookups with our initial path. 
->             self._path2confmods[None] = self.getconftestmodules(anchor)
               #print " -> ", conftest._path2confmods
               break
test/conftesthandle.py - line 45
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
   def getconftestmodules(self, path):
       """ return a list of imported conftest modules for the given path.  """ 
       try:
           clist = self._path2confmods[path]
       except KeyError:
           dp = path.dirpath()
           if dp == path: 
               return [importconfig(defaultconftestpath)]
->         clist = self.getconftestmodules(dp)
           conftestpath = path.join("conftest.py")
           if conftestpath.check(file=1):
               clist.append(importconfig(conftestpath))
           self._path2confmods[path] = clist
       # be defensive: avoid changes from caller side to
       # affect us by always returning a copy of the actual list 
       return clist[:]
test/conftesthandle.py - line 48
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
   def getconftestmodules(self, path):
       """ return a list of imported conftest modules for the given path.  """ 
       try:
           clist = self._path2confmods[path]
       except KeyError:
           dp = path.dirpath()
           if dp == path: 
               return [importconfig(defaultconftestpath)]
           clist = self.getconftestmodules(dp)
           conftestpath = path.join("conftest.py")
           if conftestpath.check(file=1):
->             clist.append(importconfig(conftestpath))
           self._path2confmods[path] = clist
       # be defensive: avoid changes from caller side to
       # affect us by always returning a copy of the actual list 
       return clist[:]
test/conftesthandle.py - line 72
68
69
70
71
72
73
74
75
76
77
78
79
   def importconfig(configpath):
       # We could have used caching here, but it's redundant since
       # they're cached on path anyway, so we use it only when doing rget_path
       assert configpath.check(), configpath
->     if not configpath.dirpath('__init__.py').check(file=1): 
           # HACK: we don't want any "globally" imported conftest.py, 
           #       prone to conflicts and subtle problems 
           modname = str(configpath).replace('.', configpath.sep)
           mod = configpath.pyimport(modname=modname)
       else:
           mod = configpath.pyimport()
       return mod
path/common.py - line 114
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
   def check(self, **kw):
       """ check a path for existence, or query its properties
   
               without arguments, this returns True if the path exists (on the
               filesystem), False if not
   
               with (keyword only) arguments, the object compares the value
               of the argument with the value of a property with the same name
               (if it has one, else it raises a TypeError)
   
               when for example the keyword argument 'ext' is '.py', this will
               return True if self.ext == '.py', False otherwise
           """
       if kw:
           kw = kw.copy()
           if not checktype(self, kw):
               return False
       else:
           kw = {'exists' : 1}
->     return self.Checkers(self)._evaluate(kw)
path/common.py - line 75
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
   def _evaluate(self, kw):
       for name, value in kw.items():
           invert = False
           meth = None
           try:
               meth = getattr(self, name)
           except AttributeError:
               if name[:3] == 'not':
                   invert = True
                   try:
                       meth = getattr(self, name[3:])
                   except AttributeError:
                       pass
           if meth is None:
               raise TypeError, "no %r checker available for %r" % (name, self.path)
           try:
               if meth.im_func.func_code.co_argcount > 1:
                   if (not meth(value)) ^ invert:
                       return False
               else:
->                 if bool(value) ^ bool(meth()) ^ invert:
                       return False
           except (py.error.ENOENT, py.error.ENOTDIR):
               for name in self._depend_on_existence:
                   if name in kw:
                       if kw.get(name):
                           return False
                   name = 'not' + name
                   if name in kw:
                       if not kw.get(name):
                           return False
       return True
path/local/local.py - line 42
41
42
   def file(self):
->     return stat.S_ISREG(self._stat().mode)
path/local/local.py - line 33
28
29
30
31
32
33
34
35
36
   def _stat(self):
       try:
           return self._statcache
       except AttributeError:
           try:
->             self._statcache = self.path.stat()
           except py.error.ELOOP:
               self._statcache = self.path.lstat()
           return self._statcache