call site 2 for magic.revert
test/rsession/testing/test_lsession.py - line 241
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
   def test_assert_reinterpret(self):
       if not hasattr(py.std.os, 'fork'):
           py.test.skip('operating system not supported')
       tmpdir = tmp
       tmpdir.ensure("sub6", "__init__.py")
       tmpdir.ensure("sub6", "test_some.py").write(py.code.Source("""
           def test_one():
               x = [1, 2]
               assert [0] == x
           """))
       args = [str(tmpdir.join("sub6"))]
       config = py.test.config._reparse(args)
       lsession = LSession(config)
       allevents = []
->     lsession.main(reporter=allevents.append, runner=box_runner)
       testevents = [x for x in allevents 
                       if isinstance(x, repevent.ReceivedItemOutcome)]
       failevents = [i for i in testevents if i.outcome.excinfo]
       assert len(failevents) == 1
       assert len(testevents) == 1
       assert failevents[0].outcome.excinfo.value == 'assert [0] == [1, 2]'
test/rsession/rsession.py - line 210
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
   def main(self, reporter=None, runner=None):
       # check out if used options makes any sense
       args = self.config.args  
          
       hm = HostManager(self.config, hosts=[HostInfo('localhost')])
       hosts = hm.hosts
       if not self.config.option.nomagic:
           py.magic.invoke(assertion=1)
   
       reporter, startserverflag = self.init_reporter(reporter, 
           hosts, LocalReporter, args[0])
       reporter, checkfun = self.wrap_reporter(reporter)
           
       reporter(repevent.TestStarted(hosts, self.config.topdir, []))
       colitems = self.config.getcolitems()
       reporter(repevent.RsyncFinished())
   
       if runner is None:
           runner = self.init_runner()
   
       keyword = self.config.option.keyword
   
       itemgenerator = itemgen(colitems, reporter, keyword, self.reporterror)
       local_loop(self, reporter, itemgenerator, checkfun, self.config, runner=runner)
           
       retval = reporter(repevent.TestFinished())
       self.kill_server(startserverflag)
   
       if not self.config.option.nomagic:
->         py.magic.revoke(assertion=1)
   
       self.write_docs()
       return retval
magic/invoke.py - line 22
18
19
20
21
22
23
24
   def revoke(assertion=False, compile=False):
       """ revoke previously invoked magic (see invoke())."""
       if assertion:
           from py.__.magic import assertion
->         assertion.revoke()
       if compile: 
           py.magic.revert(cpy_builtin, 'compile') 
magic/assertion.py - line 31
30
31
   def revoke():
->     py.magic.revert(__builtin__, 'AssertionError')