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:
@@ -12,7 +12,7 @@ def pytest_addoption(parser):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def fake_package_dir(monkeypatch):
|
def fake_package_dir(tmp_path, monkeypatch):
|
||||||
"""
|
"""
|
||||||
Monkey-patch enough for the main() function to run
|
Monkey-patch enough for the main() function to run
|
||||||
"""
|
"""
|
||||||
@@ -25,6 +25,8 @@ def fake_package_dir(monkeypatch):
|
|||||||
return real_path_exists(path)
|
return real_path_exists(path)
|
||||||
|
|
||||||
args = ["cibuildwheel", str(MOCK_PACKAGE_DIR)]
|
args = ["cibuildwheel", str(MOCK_PACKAGE_DIR)]
|
||||||
|
tmp_path.joinpath(MOCK_PACKAGE_DIR).mkdir()
|
||||||
monkeypatch.setattr(Path, "exists", mock_path_exists)
|
monkeypatch.setattr(Path, "exists", mock_path_exists)
|
||||||
monkeypatch.setattr(sys, "argv", args)
|
monkeypatch.setattr(sys, "argv", args)
|
||||||
|
monkeypatch.chdir(tmp_path)
|
||||||
return args
|
return args
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ def mock_build_container(monkeypatch):
|
|||||||
|
|
||||||
|
|
||||||
def test_build_default_launches(mock_build_container, fake_package_dir, 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()
|
main()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user