@@ -177,6 +177,29 @@ def test_no_args_compiles_path(self):
177177 self .assertNotCompiled (self .initfn )
178178 self .assertNotCompiled (self .barfn )
179179
180+ def test_no_args_respects_force_flag (self ):
181+ bazfn = script_helper .make_script (self .directory , 'baz' , '' )
182+ self .assertRunOK (PYTHONPATH = self .directory )
183+ pycpath = imp .cache_from_source (bazfn )
184+ # Set atime/mtime backward to avoid file timestamp resolution issues
185+ os .utime (pycpath , (time .time ()- 60 ,)* 2 )
186+ mtime = os .stat (pycpath ).st_mtime
187+ # Without force, no recompilation
188+ self .assertRunOK (PYTHONPATH = self .directory )
189+ mtime2 = os .stat (pycpath ).st_mtime
190+ self .assertEqual (mtime , mtime2 )
191+ # Now force it.
192+ self .assertRunOK ('-f' , PYTHONPATH = self .directory )
193+ mtime2 = os .stat (pycpath ).st_mtime
194+ self .assertNotEqual (mtime , mtime2 )
195+
196+ def test_no_args_respects_quiet_flag (self ):
197+ script_helper .make_script (self .directory , 'baz' , '' )
198+ noisy = self .assertRunOK (PYTHONPATH = self .directory )
199+ self .assertIn (b'Listing ' , noisy )
200+ quiet = self .assertRunOK ('-q' , PYTHONPATH = self .directory )
201+ self .assertNotIn (b'Listing ' , quiet )
202+
180203 # Ensure that the default behavior of compileall's CLI is to create
181204 # PEP 3147 pyc/pyo files.
182205 for name , ext , switch in [
0 commit comments