Skip to content

Commit 9bb45e4

Browse files
committed
test(macos): Don't delete extra_makefile on macos
For some reason, even though the test succeeds, the actual file isn't created like on linux. Maybe about versions/implementations of make?
1 parent 0eabf4f commit 9bb45e4

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

test/t/conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,16 @@ def completion(request, bash: pexpect.spawn) -> CompletionResult:
915915
return assert_complete(bash, marker.args[0], **marker.kwargs)
916916

917917

918+
def current_os() -> str:
919+
platform = sys.platform
920+
if platform == "darwin":
921+
return "macos"
922+
elif platform == "linux":
923+
return "linux"
924+
else:
925+
return platform
926+
927+
918928
def in_container() -> bool:
919929
try:
920930
container = subprocess.check_output(

test/t/test_make.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
import pytest
44

5-
from conftest import assert_complete
5+
from conftest import assert_complete, current_os
66

77

88
class TestMake:
99
@pytest.fixture
1010
def remove_extra_makefile(self, bash):
1111
yield
12-
os.remove(f"{bash.cwd}/make/extra_makefile")
12+
# For some reason macos make doesn't actually create extra_makefile
13+
if current_os() != "macos":
14+
os.remove(f"{bash.cwd}/make/extra_makefile")
1315

1416
@pytest.mark.complete("make -f Ma", cwd="make")
1517
def test_1(self, completion):

0 commit comments

Comments
 (0)