call site 3 for magic.revoke
test/testing/test_collect.py - line 269
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
   def test_custom_NONpython_collection_from_conftest():
       o = tmpdir.ensure('customconfigtest_nonpython', dir=1)
       o.ensure('conftest.py').write("""if 1:
           import py
           class CustomItem(py.test.collect.Item): 
               def run(self):
                   pass
   
           class Directory(py.test.collect.Directory):
               def filefilter(self, fspath):
                   return fspath.check(basestarts='check_', ext='.txt')
               def join(self, name):
                   if not name.endswith('.txt'): 
                       return super(Directory, self).join(name) 
                   p = self.fspath.join(name) 
                   if p.check(file=1): 
                       return CustomItem(p, parent=self)
           """)
       checkfile = o.ensure('somedir', 'moredir', 'check_something.txt')
   
       for x in (o, checkfile, checkfile.dirpath()): 
           print "checking that %s returns custom items" % (x,) 
           config = py.test.config._reparse([x])
           col = config._getcollector(x)
           assert len(list(col._tryiter(py.test.collect.Item))) == 1
           #assert items[1].__class__.__name__ == 'MyFunction'
   
       # test that running a session works from the directories
       old = o.chdir() 
       try: 
           config = py.test.config._reparse([]) 
           out = py.std.cStringIO.StringIO()
           session = config._getsessionclass()(config, out) 
           session.main() 
           l = session.getitemoutcomepairs(Passed) 
           assert len(l) == 1
       finally: 
           old.chdir() 
   
       # test that running the file directly works 
       config = py.test.config._reparse([str(checkfile)]) 
       out = py.std.cStringIO.StringIO()
       session = config._getsessionclass()(config, out) 
->     session.main() 
       l = session.getitemoutcomepairs(Passed) 
       assert len(l) == 1
test/session.py - line 67
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 159
158
159
160
161
162
163
164
   def footer(self, colitems):
->     super(TerminalSession, self).footer(colitems) 
       self.endtime = now()
       self.out.line() 
       self.skippedreasons()
       self.failures()
       self.summaryline()
test/session.py - line 25
21
22
23
24
25
   def footer(self, colitems):
       """ teardown any resources after a test run. """ 
       py.test.collect.Function._state.teardown_all()
       if not self.config.option.nomagic:
->         py.magic.revoke(assertion=1)