Home
last modified time | relevance | path

Searched refs:TESTFN (Results 1 – 25 of 117) sorted by relevance

12345

/third_party/python/Lib/test/
Dtest_posix.py26 os_helper.TESTFN + '-dummy-symlink')
48 with open(os_helper.TESTFN, "wb"):
50 self.teardown_files = [ os_helper.TESTFN ]
159 fp = open(os_helper.TESTFN)
169 fp = open(os_helper.TESTFN, 'w+')
180 with open(os_helper.TESTFN, 'w') as fp:
183 posix.truncate(os_helper.TESTFN, 0)
274 fd = os.open(os_helper.TESTFN, os.O_WRONLY | os.O_CREAT)
286 fd = os.open(os_helper.TESTFN, os.O_RDWR | os.O_CREAT)
298 fd = os.open(os_helper.TESTFN, os.O_RDWR | os.O_CREAT)
[all …]
Daudiotests.py2 from test.support.os_helper import TESTFN, unlink
27 unlink(TESTFN)
72 f = self.create_file(TESTFN)
83 with self.module.open(TESTFN, 'wb'):
86 with open(TESTFN, 'wb') as testfile:
91 with open(TESTFN, 'wb') as testfile:
98 with open(TESTFN, 'rb') as testfile:
112 with self.module.open(TESTFN, 'wb') as f:
117 with self.module.open(TESTFN) as f:
127 f = self.create_file(TESTFN)
[all …]
Dtest_fileio.py13 from test.support.os_helper import (TESTFN, TESTFN_UNICODE, make_bad_fd)
25 self.f = self.FileIO(TESTFN, 'w')
30 os.remove(TESTFN)
83 with self.FileIO(TESTFN, 'r') as f:
93 with self.FileIO(TESTFN, 'r') as f:
99 with self.FileIO(TESTFN, 'r') as f:
109 with self.FileIO(TESTFN, 'r') as f:
115 with self.FileIO(TESTFN, 'r') as f:
121 with self.FileIO(TESTFN, 'r') as f:
130 self.f = self.FileIO(TESTFN, 'rb')
[all …]
Dtest_file.py11 from test.support.os_helper import TESTFN
20 self.f = self.open(TESTFN, 'wb')
25 os_helper.unlink(TESTFN)
49 self.f = self.open(TESTFN, 'rb')
57 self.f = self.open(TESTFN, encoding="utf-8")
66 self.f = self.open(TESTFN, 'rb')
89 self.assertEqual(f.name, TESTFN)
145 os_helper.unlink(TESTFN)
149 self.open(TESTFN, 'wb').close()
152 f = self.open(TESTFN, mode)
[all …]
Dtest_largefile.py14 from test.support.os_helper import TESTFN, unlink
20 TESTFN2 = TESTFN + '2'
26 if os.path.exists(TESTFN):
31 with self.open(TESTFN, mode) as f:
47 with cls.open(TESTFN, 'wb'):
49 if not os.stat(TESTFN)[stat.ST_SIZE] == 0:
65 with self.open(TESTFN, "rb") as f:
70 self.assertEqual(os.stat(TESTFN)[stat.ST_SIZE], size+1)
73 with self.open(TESTFN, 'rb') as f:
104 with self.open(TESTFN, 'rb') as f:
[all …]
Dtest_zipfile.py25 from test.support.os_helper import TESTFN, unlink, rmtree, temp_dir, temp_cwd
28 TESTFN2 = TESTFN + "2"
29 TESTFNDIR = TESTFN + "d"
57 with open(TESTFN, "wb") as fp:
64 zipfp.write(TESTFN, "another.name")
65 zipfp.write(TESTFN, TESTFN)
76 self.assertEqual(zipfp.read(TESTFN), self.data)
100 self.assertIn(TESTFN, names)
109 self.assertIn(TESTFN, names)
117 for nm in (TESTFN, "another.name", "strfile", "written-open-w"):
[all …]
Dtest_stat.py8 from test.support.os_helper import TESTFN
83 os.remove(TESTFN)
86 os.rmdir(TESTFN)
91 def get_mode(self, fname=TESTFN, lstat=True):
117 with open(TESTFN, 'w'):
120 os.chmod(TESTFN, 0o700)
127 os.chmod(TESTFN, 0o070)
134 os.chmod(TESTFN, 0o007)
141 os.chmod(TESTFN, 0o444)
147 os.chmod(TESTFN, 0o700)
[all …]
Dtest_marshal.py21 with open(os_helper.TESTFN, "wb") as f:
23 with open(os_helper.TESTFN, "rb") as f:
27 os_helper.unlink(os_helper.TESTFN)
285 with open(os_helper.TESTFN, 'wb') as f:
291 with open(os_helper.TESTFN, 'rb') as f:
298 os_helper.unlink(os_helper.TESTFN)
520 _testcapi.pymarshal_write_long_to_file(0x12345678, os_helper.TESTFN, v)
521 with open(os_helper.TESTFN, 'rb') as f:
523 os_helper.unlink(os_helper.TESTFN)
529 _testcapi.pymarshal_write_object_to_file(obj, os_helper.TESTFN, v)
[all …]
Dtest_mmap.py3 from test.support.os_helper import TESTFN, unlink
21 if os.path.exists(TESTFN):
22 os.unlink(TESTFN)
26 os.unlink(TESTFN)
34 f = open(TESTFN, 'bw+')
114 f = open(TESTFN, 'rb')
127 with open(TESTFN, "wb") as fp:
129 with open(TESTFN, "rb") as f:
176 with open(TESTFN, "rb") as fp:
181 with open(TESTFN, "r+b") as f:
[all …]
Dtest_pipes.py7 from test.support.os_helper import TESTFN, unlink
16 TESTFN2 = TESTFN + "2"
23 for f in (TESTFN, TESTFN2):
31 with t.open(TESTFN, 'w') as f:
33 with open(TESTFN) as f:
39 with open(TESTFN, 'w') as f:
43 t.copy(TESTFN, TESTFN2)
50 with open(TESTFN, 'w') as f:
54 f = t.open(TESTFN, 'r')
63 with open(TESTFN, 'w') as f:
[all …]
Dtest_zipfile64.py21 from test.support import TESTFN, requires_zlib
23 TESTFN2 = TESTFN + "2"
35 with open(TESTFN, "wb") as fp:
87 for fname in TESTFN, TESTFN2:
96 with zipfile.ZipFile(TESTFN, mode="w", allowZip64=True) as zipf:
103 with zipfile.ZipFile(TESTFN, mode="r") as zipf2:
110 with zipfile.ZipFile(TESTFN, mode="w", allowZip64=False) as zipf:
120 with zipfile.ZipFile(TESTFN, mode="a", allowZip64=False) as zipf:
127 with zipfile.ZipFile(TESTFN, mode="a", allowZip64=True) as zipf:
135 with zipfile.ZipFile(TESTFN, mode="r") as zipf2:
[all …]
Dtest_iter.py6 from test.support.os_helper import TESTFN, unlink
340 f = open(TESTFN, "w", encoding="utf-8")
346 f = open(TESTFN, "r", encoding="utf-8")
353 unlink(TESTFN)
369 f = open(TESTFN, "w", encoding="utf-8")
375 f = open(TESTFN, "r", encoding="utf-8")
384 unlink(TESTFN)
402 f = open(TESTFN, "w", encoding="utf-8")
408 f = open(TESTFN, "r", encoding="utf-8")
417 unlink(TESTFN)
[all …]
Dtest_fcntl.py11 from test.support.os_helper import TESTFN, unlink
79 unlink(TESTFN)
83 self.f = open(TESTFN, 'wb')
94 self.f = open(TESTFN, 'wb')
138 fd = os.open(os.path.dirname(os.path.abspath(TESTFN)), os.O_RDONLY)
146 self.f = open(TESTFN, 'wb+')
160 self.f = open(TESTFN, 'wb+')
163 p = Process(target=try_lockf_on_other_process_fail, args=(TESTFN, cmd))
171 self.f = open(TESTFN, 'wb+')
174 p = Process(target=try_lockf_on_other_process, args=(TESTFN, cmd))
[all …]
Dtest_univnewlines.py51 with self.open(os_helper.TESTFN, self.WRITEMODE) as fp:
56 os.unlink(os_helper.TESTFN)
61 with self.open(os_helper.TESTFN, self.READMODE) as fp:
67 with self.open(os_helper.TESTFN, self.READMODE) as fp:
73 with self.open(os_helper.TESTFN, self.READMODE) as fp:
83 with self.open(os_helper.TESTFN, self.READMODE) as fp:
110 with self.open(os_helper.TESTFN, self.READMODE) as fp:
Dtest_pdb.py1357 os_helper.unlink(os_helper.TESTFN)
1397 with open(os_helper.TESTFN, 'wb') as f:
1401 expected[0], os_helper.TESTFN, expected[1])
1403 expected, pdb.find_function(func_name, os_helper.TESTFN))
1453 with open(os_helper.TESTFN, 'wb') as f:
1455 cmd = [sys.executable, '-m', 'pdb', os_helper.TESTFN]
1506 with open(os_helper.TESTFN, 'wb') as f:
1518 cmd = [sys.executable, '-u', os_helper.TESTFN]
1532 with open(os_helper.TESTFN, 'wb') as f:
1548 cmd = [sys.executable, '-u', os_helper.TESTFN]
[all …]
Dtest_os.py175 if os.path.lexists(os_helper.TESTFN):
176 os.unlink(os_helper.TESTFN)
180 f = os.open(os_helper.TESTFN, os.O_CREAT|os.O_RDWR)
182 self.assertTrue(os.access(os_helper.TESTFN, os.W_OK))
185 first = os.open(os_helper.TESTFN, os.O_CREAT|os.O_RDWR)
207 path = os_helper.TESTFN
214 with open(os_helper.TESTFN, "w+b") as fobj:
230 self.addCleanup(os_helper.unlink, os_helper.TESTFN)
231 create_file(os_helper.TESTFN, b'test')
235 with open(os_helper.TESTFN, "rb") as fp:
[all …]
Dtest_imghdr.py8 from test.support.os_helper import TESTFN, unlink
42 unlink(TESTFN)
70 with open(TESTFN, 'wb') as stream:
74 with open(TESTFN, 'rb') as stream:
128 with open(TESTFN, 'wb') as stream:
130 with UnseekableIO(TESTFN, 'rb') as stream:
135 with open(TESTFN, 'wb') as stream:
Dtest_unicode_file_functions.py66 os.mkdir(os_helper.TESTFN)
69 self.addCleanup(os_helper.rmtree, os_helper.TESTFN)
73 name = os.path.join(os_helper.TESTFN, self.norm(name))
148 f1 = os.listdir(os_helper.TESTFN.encode(
150 f2 = os.listdir(os_helper.TESTFN)
151 sf2 = set(os.path.join(os_helper.TESTFN, f) for f in f2)
161 dirname = os.path.join(os_helper.TESTFN,
Dtest_lzma.py15 TESTFN, unlink
547 filename = pathlib.Path(TESTFN)
557 with TempFile(TESTFN, COMPRESSED_XZ):
558 with LZMAFile(TESTFN) as f:
560 with LZMAFile(TESTFN, "w") as f:
562 with LZMAFile(TESTFN, "a") as f:
566 with TempFile(TESTFN):
567 with LZMAFile(TESTFN, "r"):
569 with LZMAFile(TESTFN, "rb"):
571 with LZMAFile(TESTFN, "w"):
[all …]
Dtest_bufio.py21 os_helper.unlink(os_helper.TESTFN)
25 f = self.open(os_helper.TESTFN, "wb")
32 f = open(os_helper.TESTFN, "rb")
41 os_helper.unlink(os_helper.TESTFN)
Dtest_trace.py4 from test.support.os_helper import (TESTFN, rmtree, unlink)
356 rmtree(TESTFN)
357 unlink(TESTFN)
364 r.write_results(show_missing=True, summary=True, coverdir=TESTFN)
373 files = os.listdir(TESTFN)
385 if os.path.exists(TESTFN):
386 files = os.listdir(TESTFN)
492 filename = TESTFN + '.py'
493 modulename = os.path.basename(TESTFN)
504 with open(TESTFN, 'w', encoding='utf-8') as fd:
[all …]
/third_party/python/Lib/test/test_import/
D__init__.py26 TESTFN, rmtree, temp_umask, TESTFN_UNENCODABLE, temp_dir)
70 remove_files(TESTFN)
74 unload(TESTFN)
152 source = TESTFN + ext
154 pyc = TESTFN + "$py.class"
156 pyc = TESTFN + ".pyc"
166 if TESTFN in sys.modules:
167 del sys.modules[TESTFN]
171 mod = __import__(TESTFN)
180 forget(TESTFN)
[all …]
/third_party/python/Lib/test/test_tools/
Dtest_fixcid.py61 os.mkdir(os_helper.TESTFN)
62 self.addCleanup(os_helper.rmtree, os_helper.TESTFN)
63 c_filename = os.path.join(os_helper.TESTFN, "file.c")
66 with open(os.path.join(os_helper.TESTFN, "file.py"), "w") as file:
69 output = self.run_script(args=(os_helper.TESTFN,))
78 substfilename = os_helper.TESTFN + ".subst"
/third_party/python/Lib/test/test_importlib/
Dtest_threaded_import.py19 from test.support.os_helper import (TESTFN, unlink, rmtree)
200 os.mkdir(TESTFN)
201 self.addCleanup(shutil.rmtree, TESTFN)
202 sys.path.insert(0, TESTFN)
203 self.addCleanup(sys.path.remove, TESTFN)
206 with open(os.path.join(TESTFN, name + ".py"), "wb") as f:
238 filename = TESTFN + ".py"
242 self.addCleanup(forget, TESTFN)
245 __import__(TESTFN)
246 del sys.modules[TESTFN]
/third_party/python/Lib/distutils/tests/
Dtest_sysconfig.py14 from test.support.os_helper import TESTFN
30 if os.path.isfile(TESTFN):
31 os.remove(TESTFN)
32 elif os.path.isdir(TESTFN):
33 shutil.rmtree(TESTFN)
44 sysconfig.get_python_lib(prefix=TESTFN))
174 self.makefile = TESTFN
186 self.makefile = TESTFN
254 with open(TESTFN, 'w') as f:
262 p = subprocess.Popen([str(sys.executable), TESTFN],

12345