Skip to content

Commit 5b60cc8

Browse files
committed
fix: test_build_default_launches to use an empty package dir
test_build_default_launches was using cibuildwheel setup.cfg which led to the test failing once python 3.6 was dropped. Use an empty package, provided by fake_package_dir, to run the test.
1 parent 554b909 commit 5b60cc8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

unit_test/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def pytest_addoption(parser):
1212

1313

1414
@pytest.fixture
15-
def fake_package_dir(monkeypatch):
15+
def fake_package_dir(tmp_path, monkeypatch):
1616
"""
1717
Monkey-patch enough for the main() function to run
1818
"""
@@ -25,6 +25,8 @@ def mock_path_exists(path):
2525
return real_path_exists(path)
2626

2727
args = ["cibuildwheel", str(MOCK_PACKAGE_DIR)]
28+
tmp_path.joinpath(MOCK_PACKAGE_DIR).mkdir()
2829
monkeypatch.setattr(Path, "exists", mock_path_exists)
2930
monkeypatch.setattr(sys, "argv", args)
31+
monkeypatch.chdir(tmp_path)
3032
return args

unit_test/option_prepare_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def ignore_context_call(*args, **kwargs):
4444

4545

4646
def test_build_default_launches(mock_build_container, fake_package_dir, monkeypatch):
47-
monkeypatch.setattr(sys, "argv", ["cibuildwheel", "--platform=linux"])
47+
monkeypatch.setattr(sys, "argv", sys.argv + ["--platform=linux"])
4848

4949
main()
5050

0 commit comments

Comments
 (0)