@@ -13,35 +13,36 @@ from pkgcore import const as pkgcore_const
1313
1414# make sure to use git repo version of pkgcheck
1515main_dir = os .path .dirname (os .path .dirname (os .path .realpath (__file__ )))
16- src_dir = pjoin (main_dir , ' src' )
16+ src_dir = pjoin (main_dir , " src" )
1717sys .path .insert (0 , src_dir )
1818from pkgcheck .scripts import run
1919
20-
21- with tempfile . TemporaryDirectory ( prefix = 'pkgcheck-test-config-' ) as tempdir :
22- stubrepo = pjoin (pkgcore_const . DATA_PATH , 'stubrepo' )
23- repo_dir = pjoin (main_dir , 'testdata' , 'repos' )
24- with open ( pjoin ( tempdir , 'repos.conf' ), 'w' ) as f :
25- f . write ( textwrap .dedent (f"""\
20+ with tempfile . TemporaryDirectory ( prefix = "pkgcheck-test-config-" ) as tempdir :
21+ stubrepo = pjoin ( pkgcore_const . DATA_PATH , "stubrepo" )
22+ repo_dir = pjoin (main_dir , "testdata" , "repos" )
23+ with open ( pjoin (tempdir , "repos.conf" ), "w" ) as f :
24+ f . write (
25+ textwrap .dedent (f"""\
2626 [DEFAULT]
2727 main-repo = stubrepo
2828 [stubrepo]
2929 location = { stubrepo }
30- """ ))
30+ """ )
31+ )
3132 for repo in os .listdir (repo_dir ):
32- f .write (f' [{ repo } ]\n location = { pjoin (repo_dir , repo )} \n ' )
33+ f .write (f" [{ repo } ]\n location = { pjoin (repo_dir , repo )} \n " )
3334
3435 # create make.profile symlink
35- profile_path = pjoin (stubrepo , ' profiles' , ' default' )
36- os .symlink (profile_path , pjoin (tempdir , ' make.profile' ))
36+ profile_path = pjoin (stubrepo , " profiles" , " default" )
37+ os .symlink (profile_path , pjoin (tempdir , " make.profile" ))
3738
3839 args = sys .argv [1 :]
3940 try :
40- if args [0 ] == ' scan' :
41+ if args [0 ] == " scan" :
4142 # ignore system/user config settings
42- args = [' scan' , ' --config' , 'no' , ' --cache-dir' , tempdir ] + args [1 :]
43+ args = [" scan" , " --config" , "no" , " --cache-dir" , tempdir ] + args [1 :]
4344 except IndexError :
4445 pass
45- args = [' pkgcheck' , ' --config' , tempdir ] + args
46- with patch (' sys.argv' , args ):
47- run (' pkgcheck' )
46+ args = [" pkgcheck" , " --config" , tempdir ] + args
47+ with patch (" sys.argv" , args ):
48+ run (" pkgcheck" )
0 commit comments