call site 3 for path.local.open
doc/test_conftest.py - line 25
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
   def test_doctest_basic(): 
       # XXX get rid of the next line: 
->     py.magic.autopath().dirpath('conftest.py').copy(tmpdir.join('conftest.py'))
   
       xtxt = tmpdir.join('x.txt')
       xtxt.write(py.code.Source("""
           .. 
              >>> from os.path import abspath 
   
           hello world 
   
              >>> assert abspath 
              >>> i=3
              >>> print i
              3
   
           yes yes
   
               >>> i
               3
   
           end
       """))
       config = py.test.config._reparse([xtxt]) 
       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
path/local/local.py - line 240
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
   def copy(self, target, archive=False):
       """ copy path to target."""
       assert not archive, "XXX archive-mode not supported"
       if self.check(file=1):
           if target.check(dir=1):
               target = target.join(self.basename)
           assert self!=target
->         copychunked(self, target)
       else:
           target.ensure(dir=1)
           def rec(p):
               return p.check(link=0)
           for x in self.visit(rec=rec):
               relpath = x.relto(self)
               newx = target.join(relpath)
               if x.check(link=1):
                   newx.mksymlinkto(x.readlink())
               elif x.check(file=1):
                   copychunked(x, newx)
               elif x.check(dir=1):
                   newx.ensure(dir=1)
path/local/local.py - line 688
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
   def copychunked(src, dest):
       chunksize = 524288 # half a meg of bytes
->     fsrc = src.open('rb')
       try:
           fdest = dest.open('wb')
           try:
               while 1:
                   buf = fsrc.read(chunksize)
                   if not buf:
                       break
                   fdest.write(buf)
           finally:
               fdest.close()
       finally:
           fsrc.close()