feat: adding overrides

This commit is contained in:
Henry Schreiner
2021-10-16 21:34:02 -04:00
parent f511961b40
commit cd07697fe5
13 changed files with 405 additions and 89 deletions
+22 -14
View File
@@ -18,13 +18,13 @@ def test_output_dir(platform, intercepted_build_args, monkeypatch):
main()
assert intercepted_build_args.args[0].output_dir == OUTPUT_DIR
assert intercepted_build_args.args[0].general_build_options.output_dir == OUTPUT_DIR
def test_output_dir_default(platform, intercepted_build_args, monkeypatch):
main()
assert intercepted_build_args.args[0].output_dir == Path("wheelhouse")
assert intercepted_build_args.args[0].general_build_options.output_dir == Path("wheelhouse")
@pytest.mark.parametrize("also_set_environment", [False, True])
@@ -37,7 +37,7 @@ def test_output_dir_argument(also_set_environment, platform, intercepted_build_a
main()
assert intercepted_build_args.args[0].output_dir == OUTPUT_DIR
assert intercepted_build_args.args[0].general_build_options.output_dir == OUTPUT_DIR
def test_build_selector(platform, intercepted_build_args, monkeypatch, allow_empty):
@@ -49,7 +49,7 @@ def test_build_selector(platform, intercepted_build_args, monkeypatch, allow_emp
main()
intercepted_build_selector = intercepted_build_args.args[0].build_selector
intercepted_build_selector = intercepted_build_args.args[0].general_build_options.build_selector
assert isinstance(intercepted_build_selector, BuildSelector)
assert intercepted_build_selector("build24-this")
assert not intercepted_build_selector("skip65-that")
@@ -98,9 +98,12 @@ def test_manylinux_images(
main()
if platform == "linux":
assert fnmatch(intercepted_build_args.args[0].manylinux_images[architecture], full_image)
assert fnmatch(
intercepted_build_args.args[0].general_build_options.manylinux_images[architecture],
full_image,
)
else:
assert intercepted_build_args.args[0].manylinux_images is None
assert intercepted_build_args.args[0].general_build_options.manylinux_images is None
def get_default_repair_command(platform):
@@ -129,7 +132,7 @@ def test_repair_command(
main()
expected_repair = repair_command or get_default_repair_command(platform)
assert intercepted_build_args.args[0].repair_command == expected_repair
assert intercepted_build_args.args[0].general_build_options.repair_command == expected_repair
@pytest.mark.parametrize(
@@ -147,7 +150,7 @@ def test_environment(environment, platform_specific, platform, intercepted_build
main()
intercepted_environment = intercepted_build_args.args[0].environment
intercepted_environment = intercepted_build_args.args[0].general_build_options.environment
assert isinstance(intercepted_environment, ParsedEnvironment)
assert intercepted_environment.as_dictionary(prev_environment={}) == environment
@@ -166,7 +169,10 @@ def test_test_requires(
main()
assert intercepted_build_args.args[0].test_requires == (test_requires or "").split()
assert (
intercepted_build_args.args[0].general_build_options.test_requires
== (test_requires or "").split()
)
@pytest.mark.parametrize("test_extras", [None, "extras"])
@@ -181,7 +187,7 @@ def test_test_extras(test_extras, platform_specific, platform, intercepted_build
main()
assert intercepted_build_args.args[0].test_extras == (
assert intercepted_build_args.args[0].general_build_options.test_extras == (
"[" + test_extras + "]" if test_extras else ""
)
@@ -200,7 +206,7 @@ def test_test_command(
main()
assert intercepted_build_args.args[0].test_command == (test_command or "")
assert intercepted_build_args.args[0].general_build_options.test_command == (test_command or "")
@pytest.mark.parametrize("before_build", [None, "before --build"])
@@ -217,7 +223,7 @@ def test_before_build(
main()
assert intercepted_build_args.args[0].before_build == (before_build or "")
assert intercepted_build_args.args[0].general_build_options.before_build == (before_build or "")
@pytest.mark.parametrize("build_verbosity", [None, 0, 2, -2, 4, -4])
@@ -235,7 +241,9 @@ def test_build_verbosity(
main()
expected_verbosity = max(-3, min(3, int(build_verbosity or 0)))
assert intercepted_build_args.args[0].build_verbosity == expected_verbosity
assert (
intercepted_build_args.args[0].general_build_options.build_verbosity == expected_verbosity
)
@pytest.mark.parametrize(
@@ -286,4 +294,4 @@ def test_before_all(before_all, platform_specific, platform, intercepted_build_a
main()
assert intercepted_build_args.args[0].before_all == (before_all or "")
assert intercepted_build_args.args[0].general_build_options.before_all == (before_all or "")