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.
This commit is contained in:
mayeut
2022-07-19 07:47:20 +02:00
parent bc17f103f1
commit 054230e01b
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -12,7 +12,7 @@ def pytest_addoption(parser):
@pytest.fixture
def fake_package_dir(monkeypatch):
def fake_package_dir(tmp_path, monkeypatch):
"""
Monkey-patch enough for the main() function to run
"""
@@ -25,6 +25,8 @@ def fake_package_dir(monkeypatch):
return real_path_exists(path)
args = ["cibuildwheel", str(MOCK_PACKAGE_DIR)]
tmp_path.joinpath(MOCK_PACKAGE_DIR).mkdir()
monkeypatch.setattr(Path, "exists", mock_path_exists)
monkeypatch.setattr(sys, "argv", args)
monkeypatch.chdir(tmp_path)
return args
+1 -1
View File
@@ -44,7 +44,7 @@ def mock_build_container(monkeypatch):
def test_build_default_launches(mock_build_container, fake_package_dir, monkeypatch):
monkeypatch.setattr(sys, "argv", ["cibuildwheel", "--platform=linux"])
monkeypatch.setattr(sys, "argv", sys.argv + ["--platform=linux"])
main()