Merge pull request #944 from tahoe-lafs/3572.pypy-has-no-refcounting

Fix intermittent failing test on PyPy

Fixes ticket:3572
This commit is contained in:
Itamar Turner-Trauring 2020-12-23 09:14:06 -05:00 committed by GitHub
commit 4e41144867
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

0
newsfragments/3572.minor Normal file
View File

View File

@ -2327,7 +2327,8 @@ class SystemTest(SystemTestMixin, RunBinTahoeMixin, unittest.TestCase):
files.append(fn)
data = "data to be uploaded: file%d\n" % i
datas.append(data)
open(fn,"wb").write(data)
with open(fn, "wb") as f:
f.write(data)
def _check_stdout_against(out_and_err, filenum=None, data=None):
(out, err) = out_and_err
@ -2505,13 +2506,18 @@ class SystemTest(SystemTestMixin, RunBinTahoeMixin, unittest.TestCase):
# recursive copy: setup
dn = os.path.join(self.basedir, "dir1")
os.makedirs(dn)
open(os.path.join(dn, "rfile1"), "wb").write("rfile1")
open(os.path.join(dn, "rfile2"), "wb").write("rfile2")
open(os.path.join(dn, "rfile3"), "wb").write("rfile3")
with open(os.path.join(dn, "rfile1"), "wb") as f:
f.write("rfile1")
with open(os.path.join(dn, "rfile2"), "wb") as f:
f.write("rfile2")
with open(os.path.join(dn, "rfile3"), "wb") as f:
f.write("rfile3")
sdn2 = os.path.join(dn, "subdir2")
os.makedirs(sdn2)
open(os.path.join(sdn2, "rfile4"), "wb").write("rfile4")
open(os.path.join(sdn2, "rfile5"), "wb").write("rfile5")
with open(os.path.join(sdn2, "rfile4"), "wb") as f:
f.write("rfile4")
with open(os.path.join(sdn2, "rfile5"), "wb") as f:
f.write("rfile5")
# from disk into tahoe
d.addCallback(run, "cp", "-r", dn, "tahoe:")