11import os
2+ import sys
23
34import pytest
45
56from conftest import assert_complete
67
78
89class TestMake :
10+ @pytest .fixture
11+ def remove_extra_makefile (self , bash ):
12+ yield
13+ # For some reason macos make doesn't actually create extra_makefile
14+ if sys .platform != "darwin" :
15+ os .remove (f"{ bash .cwd } /make/extra_makefile" )
16+
917 @pytest .mark .complete ("make -f Ma" , cwd = "make" )
1018 def test_1 (self , completion ):
1119 assert completion == "kefile"
1220
1321 @pytest .mark .complete ("make ." , cwd = "make" , require_cmd = True )
14- def test_2 (self , bash , completion ):
22+ def test_2 (self , bash , completion , remove_extra_makefile ):
1523 """Hidden targets."""
1624 assert completion == ".cache/ .test_passes" .split ()
17- os .remove (f"{ bash .cwd } /make/extra_makefile" )
1825
1926 @pytest .mark .complete ("make .cache/" , cwd = "make" , require_cmd = True )
20- def test_3 (self , bash , completion ):
27+ def test_3 (self , bash , completion , remove_extra_makefile ):
2128 assert completion == ".cache/1 .cache/2" .split ()
22- os .remove (f"{ bash .cwd } /make/extra_makefile" )
2329
2430 @pytest .mark .complete ("make " , cwd = "shared/empty_dir" )
2531 def test_4 (self , completion ):
@@ -30,24 +36,20 @@ def test_5(self, completion):
3036 assert completion
3137
3238 @pytest .mark .complete ("make " , cwd = "make" , require_cmd = True )
33- def test_6 (self , bash , completion ):
39+ def test_6 (self , bash , completion , remove_extra_makefile ):
3440 assert completion == "all clean extra_makefile install sample" .split ()
35- os .remove (f"{ bash .cwd } /make/extra_makefile" )
3641
3742 @pytest .mark .complete ("make .cache/." , cwd = "make" , require_cmd = True )
38- def test_7 (self , bash , completion ):
43+ def test_7 (self , bash , completion , remove_extra_makefile ):
3944 assert completion == ".cache/.1 .cache/.2" .split ()
40- os .remove (f"{ bash .cwd } /make/extra_makefile" )
4145
4246 @pytest .mark .complete ("make -C make " , require_cmd = True )
43- def test_8 (self , bash , completion ):
47+ def test_8 (self , bash , completion , remove_extra_makefile ):
4448 assert completion == "all clean extra_makefile install sample" .split ()
45- os .remove (f"{ bash .cwd } /make/extra_makefile" )
4649
4750 @pytest .mark .complete ("make -nC make " , require_cmd = True )
48- def test_8n (self , bash , completion ):
51+ def test_8n (self , bash , completion , remove_extra_makefile ):
4952 assert completion == "all clean extra_makefile install sample" .split ()
50- os .remove (f"{ bash .cwd } /make/extra_makefile" )
5153
5254 @pytest .mark .complete ("make -" , require_cmd = True )
5355 def test_9 (self , completion ):
0 commit comments