6
6
7
7
8
8
class TestMake :
9
+ @pytest .fixture
10
+ def remove_extra_makefile (self , bash ):
11
+ yield
12
+ os .remove (f"{ bash .cwd } /make/extra_makefile" )
13
+
9
14
@pytest .mark .complete ("make -f Ma" , cwd = "make" )
10
15
def test_1 (self , completion ):
11
16
assert completion == "kefile"
12
17
13
18
@pytest .mark .complete ("make ." , cwd = "make" , require_cmd = True )
14
- def test_2 (self , bash , completion ):
19
+ def test_2 (self , bash , completion , remove_extra_makefile ):
15
20
"""Hidden targets."""
16
21
assert completion == ".cache/ .test_passes" .split ()
17
- os .remove (f"{ bash .cwd } /make/extra_makefile" )
18
22
19
23
@pytest .mark .complete ("make .cache/" , cwd = "make" , require_cmd = True )
20
- def test_3 (self , bash , completion ):
24
+ def test_3 (self , bash , completion , remove_extra_makefile ):
21
25
assert completion == ".cache/1 .cache/2" .split ()
22
- os .remove (f"{ bash .cwd } /make/extra_makefile" )
23
26
24
27
@pytest .mark .complete ("make " , cwd = "shared/empty_dir" )
25
28
def test_4 (self , completion ):
@@ -30,24 +33,20 @@ def test_5(self, completion):
30
33
assert completion
31
34
32
35
@pytest .mark .complete ("make " , cwd = "make" , require_cmd = True )
33
- def test_6 (self , bash , completion ):
36
+ def test_6 (self , bash , completion , remove_extra_makefile ):
34
37
assert completion == "all clean extra_makefile install sample" .split ()
35
- os .remove (f"{ bash .cwd } /make/extra_makefile" )
36
38
37
39
@pytest .mark .complete ("make .cache/." , cwd = "make" , require_cmd = True )
38
- def test_7 (self , bash , completion ):
40
+ def test_7 (self , bash , completion , remove_extra_makefile ):
39
41
assert completion == ".cache/.1 .cache/.2" .split ()
40
- os .remove (f"{ bash .cwd } /make/extra_makefile" )
41
42
42
43
@pytest .mark .complete ("make -C make " , require_cmd = True )
43
- def test_8 (self , bash , completion ):
44
+ def test_8 (self , bash , completion , remove_extra_makefile ):
44
45
assert completion == "all clean extra_makefile install sample" .split ()
45
- os .remove (f"{ bash .cwd } /make/extra_makefile" )
46
46
47
47
@pytest .mark .complete ("make -nC make " , require_cmd = True )
48
- def test_8n (self , bash , completion ):
48
+ def test_8n (self , bash , completion , remove_extra_makefile ):
49
49
assert completion == "all clean extra_makefile install sample" .split ()
50
- os .remove (f"{ bash .cwd } /make/extra_makefile" )
51
50
52
51
@pytest .mark .complete ("make -" , require_cmd = True )
53
52
def test_9 (self , completion ):
0 commit comments