call site 0 for process.cmdexec
doc/example/pytest/test_failures.py - line 9
6
7
8
9
10
11
12
13
   def test_failure_demo_fails_properly(): 
       config = py.test.config._reparse([failure_demo]) 
       session = config.initsession()
->     session.main()
       l = session.getitemoutcomepairs(Failed)
       assert len(l) == 21 
       l = session.getitemoutcomepairs(Passed)
       assert not l 
test/session.py - line 59
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/terminal/terminal.py - line 132
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
   def header(self, colitems): 
       super(TerminalSession, self).header(colitems) 
       self.out.sep("=", "test process starts")
       option = self.config.option 
       modes = []
       for name in 'looponfailing', 'exitfirst', 'nomagic': 
           if getattr(option, name): 
               modes.append(name) 
       #if self._isremoteoption._fromremote:
       #    modes.insert(0, 'child process') 
       #else:
       #    modes.insert(0, 'inprocess')
       #mode = "/".join(modes)
       #self.out.line("testing-mode: %s" % mode)
       self.out.line("executable:   %s  (%s)" %
                         (py.std.sys.executable, repr_pythonversion()))
->     rev = py.__pkg__.getrev()
       self.out.line("using py lib: %s <rev %s>" % (
                      py.path.local(py.__file__).dirpath(), rev))
       
       if self.config.option.traceconfig or self.config.option.verbose: 
   
           for x in colitems: 
               self.out.line("test target:  %s" %(x.fspath,))
   
           conftestmodules = self.config._conftest.getconftestmodules(None)
           for i,x in py.builtin.enumerate(conftestmodules):
               self.out.line("initial conf %d: %s" %(i, x.__file__)) 
   
           #for i, x in py.builtin.enumerate(py.test.config.configpaths):
           #    self.out.line("initial testconfig %d: %s" %(i, x))
           #additional = py.test.config.getfirst('additionalinfo')
           #if additional:
           #    for key, descr in additional():
           #        self.out.line("%s: %s" %(key, descr))
       self.out.line() 
       self.starttime = now()
initpkg.py - line 151
147
148
149
150
151
152
153
154
155
   def getrev(self):
       import py
       p = py.path.svnwc(self.module.__file__).dirpath()
       try:
->         return p.info().rev
       except (KeyboardInterrupt, MemoryError, SystemExit):
           raise
       except:
           return 'unknown'
path/svn/wccommand.py - line 464
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
   def info(self, usecache=1):
       """ return an Info structure with svn-provided information. """
       info = usecache and cache.info.get(self)
       if not info:
           try:
->             output = self._svn('info')
           except py.process.cmdexec.Error, e:
               if e.err.find('Path is not a working copy directory') != -1:
                   raise py.error.ENOENT(self, e.err)
               raise
           # XXX SVN 1.3 has output on stderr instead of stdout (while it does
           # return 0!), so a bit nasty, but we assume no output is output
           # to stderr...
           if (output.strip() == '' or 
                   output.lower().find('not a versioned resource') != -1):
               raise py.error.ENOENT(self, output)
           info = InfoSvnWCCommand(output)
   
           # Can't reliably compare on Windows without access to win32api
           if py.std.sys.platform != 'win32': 
               if info.path != self.localpath: 
                   raise py.error.ENOENT(self, "not a versioned resource:" + 
                           " %s != %s" % (info.path, self.localpath)) 
           cache.info[self] = info
       self.rev = info.rev
       return info
path/svn/wccommand.py - line 97
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
   def _svn(self, cmd, *args):
       l = ['svn %s' % cmd]
       args = [self._escape(item) for item in args]
       l.extend(args)
       l.append('"%s"' % self._escape(self.strpath))
       # try fixing the locale because we can't otherwise parse
       string = svncommon.fixlocale() + " ".join(l)
       if DEBUG:
           print "execing", string
       try:
           try:
               key = 'LC_MESSAGES'
               hold = os.environ.get(key)
               os.environ[key] = 'C'
->             out = py.process.cmdexec(string)
           finally:
               if hold:
                   os.environ[key] = hold
               else:
                   del os.environ[key]
       except py.process.cmdexec.Error, e:
           strerr = e.err.lower()
           if strerr.find('file not found') != -1: 
               raise py.error.ENOENT(self) 
           if (strerr.find('file exists') != -1 or 
               strerr.find('file already exists') != -1 or
               strerr.find("can't create directory") != -1):
               raise py.error.EEXIST(self)
           raise
       return out