Lines Matching +full:path +full:- +full:exists
57 self.source_path = os.path.join(self.directory, '_test.py')
60 self.cwd_drive = os.path.splitdrive(os.getcwd())[0]
62 # current working directory path and the 'self.source_path' might be
65 drive = os.path.splitdrive(self.source_path)[0]
78 self.assertTrue(os.path.exists(self.pyc_path))
79 self.assertFalse(os.path.exists(self.cache_path))
89 assert os.path.islink(self.pyc_path)
93 @unittest.skipIf(not os.path.exists(os.devnull) or os.path.isfile(os.devnull),
94 'requires os.devnull and for it to be a non-regular file')
96 # In the face of a cfile argument being a non-regular file, bail out.
103 self.assertTrue(os.path.exists(self.cache_path))
107 py_compile.compile(os.path.basename(self.source_path),
108 os.path.basename(self.pyc_path))
109 self.assertTrue(os.path.exists(self.pyc_path))
110 self.assertFalse(os.path.exists(self.cache_path))
113 py_compile.compile(os.path.relpath(self.source_path),
114 os.path.relpath(self.pyc_path))
115 self.assertTrue(os.path.exists(self.pyc_path))
116 self.assertFalse(os.path.exists(self.cache_path))
135 bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py')
138 self.assertFalse(os.path.exists(
143 self.assertTrue(os.path.exists(self.pyc_path))
144 self.assertFalse(os.path.exists(self.cache_path))
155 @unittest.skipIf(sys.flags.optimize > 0, 'test does not work with -O')
158 # py_compile foo.bar.py -> __pycache__/foo.cpython-34.pyc
159 weird_path = os.path.join(self.directory, 'foo.bar.py')
162 head, tail = os.path.split(cache_path)
163 penultimate_tail = os.path.basename(head)
165 os.path.join(penultimate_tail, tail),
166 os.path.join(
172 self.assertTrue(os.path.exists(cache_path))
173 self.assertFalse(os.path.exists(pyc_path))
176 # Specifying optimized bytecode should lead to a path reflecting that.
177 self.assertIn('opt-2', py_compile.compile(self.source_path, optimize=2))
198 bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py')
225 self.source_path = os.path.join(self.directory, '_test.py')
238 if args and args[0] == '-' and 'input' in kwargs:
239 return subprocess.run([sys.executable, '-m', 'py_compile', '-'],
242 return script_helper.assert_python_ok('-m', 'py_compile', *args, **kwargs)
245 return script_helper.assert_python_failure('-m', 'py_compile', *args)
248 result = self.pycompilecmd('-', input=self.source_path)
252 self.assertTrue(os.path.exists(self.cache_path))
259 self.assertTrue(os.path.exists(self.cache_path))
262 bad_syntax = os.path.join(os.path.dirname(__file__), 'badsyntax_3131.py')
269 bad_syntax = os.path.join(os.path.dirname(__file__), 'badsyntax_3131.py')
270 rc, stdout, stderr = self.pycompilecmd_failure('-q', bad_syntax)
276 should_not_exists = os.path.join(os.path.dirname(__file__), 'should_not_exists.py')
283 should_not_exists = os.path.join(os.path.dirname(__file__), 'should_not_exists.py')
284 rc, stdout, stderr = self.pycompilecmd_failure('-q', self.source_path, should_not_exists)