1919import os
2020from common .base import TestBase
2121
22+
2223class TestCaching (TestBase ):
2324 """Caching tests"""
25+
2426 # This line is mandatory
2527 __test_path__ = os .path .dirname (os .path .abspath (__file__ ))
2628
@@ -33,21 +35,23 @@ def test_bazel_test_code_checker_caching(self):
3335 """Tests whether bazel uses cached output for unchanged files"""
3436 modified_file = "secondary.cc"
3537 target = "//test/unit/caching:code_checker_caching"
36- self .check_command (f"cp { modified_file } { modified_file } .back" ,
37- exit_code = 0 )
38+ self .check_command (
39+ f"cp { modified_file } { modified_file } .back" , exit_code = 0
40+ )
3841 self .check_command (f"bazel build { target } " , exit_code = 0 )
3942 try :
40- with open (f"{ modified_file } " , 'a' ,
41- encoding = 'utf-8' ) as f :
43+ with open (f"{ modified_file } " , "a" , encoding = "utf-8" ) as f :
4244 f .write ("//test" )
4345 except FileNotFoundError :
4446 self .fail (f"File not found: { modified_file } " )
4547 stdout , stderr = self .check_command (
46- f"bazel build { target } --subcommands" , exit_code = 0 )
48+ f"bazel build { target } --subcommands" , exit_code = 0
49+ )
4750 content = stdout + stderr
48- self .check_command (f"mv { modified_file } .back { modified_file } " ,
49- exit_code = 0 )
50- self .assertEqual (content .count ("SUBCOMMAND" ),1 )
51+ self .check_command (
52+ f"mv { modified_file } .back { modified_file } " , exit_code = 0
53+ )
54+ self .assertEqual (content .count ("SUBCOMMAND" ), 1 )
5155
5256
5357if __name__ == "__main__" :
0 commit comments