[pypy-commit] pypy py3.6: unlink deleted the test file that the other tests depended on

cfbolz pypy.commits at gmail.com
Wed Feb 20 08:05:59 EST 2019


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: py3.6
Changeset: r96113:dcf828c11e94
Date: 2019-02-20 13:38 +0100
http://bitbucket.org/pypy/pypy/changeset/dcf828c11e94/

Log:	unlink deleted the test file that the other tests depended on

diff --git a/pypy/module/posix/test/test_posix2.py b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -23,6 +23,8 @@
     mod.path = udir.join('posixtestfile.txt')
     mod.path.write("this is a test")
     mod.path2 = udir.join('test_posix2-')
+    mod.path3 = udir.join('unlinktestfile.txt')
+    mod.path3.write("delete me!")
     pdir = udir.ensure('posixtestdir', dir=True)
     pdir.join('file1').write("test1")
     os.chmod(str(pdir.join('file1')), 0o600)
@@ -66,6 +68,7 @@
         cls.w_os = space.appexec([], "(): import os as m ; return m")
         cls.w_path = space.wrap(str(path))
         cls.w_path2 = space.wrap(str(path2))
+        cls.w_path3 = space.wrap(str(path3))
         cls.w_pdir = space.wrap(str(pdir))
         cls.w_bytes_dir = space.newbytes(str(bytes_dir))
         cls.w_esurrogate_dir = space.newbytes(str(esurrogate_dir))
@@ -391,7 +394,7 @@
 
     def test_unlink(self):
         os = self.posix
-        path = self.path
+        path = self.path3
         with open(path, 'wb'):
             pass
         class Path:


More information about the pypy-commit mailing list