From 4661c8972c4a710aec51edab10994db9f16a973a Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Mon, 1 Mar 2021 13:05:34 +0700 Subject: [PATCH] Fix failing tests --- tests/test_cli_compile.py | 40 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/tests/test_cli_compile.py b/tests/test_cli_compile.py index a3ef1e582..1842f1b47 100644 --- a/tests/test_cli_compile.py +++ b/tests/test_cli_compile.py @@ -39,17 +39,8 @@ def test_command_line_overrides_pip_conf(pip_with_index_conf, runner): assert "Using indexes:\n http://override.com" in out.stderr -def test_command_line_setuptools_read(make_pip_conf, runner): - make_pip_conf( - dedent( - f"""\ - [global] - disable-pip-version-check = True - find-links = {MINIMAL_WHEELS_PATH} - """ - ) - ) - +@pytest.mark.network +def test_command_line_setuptools_read(runner): with open("setup.py", "w") as package: package.write( dedent( @@ -62,16 +53,13 @@ def test_command_line_setuptools_read(make_pip_conf, runner): """ ) ) - out = runner.invoke(cli, ["--no-emit-find-links"]) + out = runner.invoke( + cli, + ["--no-header", "--no-emit-find-links", "--find-links", MINIMAL_WHEELS_PATH], + ) assert out.stderr == dedent( """\ - # - # This file is autogenerated by pip-compile - # To update, run: - # - # pip-compile --no-emit-find-links - # small-fake-a==0.1 # via fake-setuptools-a (setup.py) """ @@ -81,6 +69,7 @@ def test_command_line_setuptools_read(make_pip_conf, runner): assert os.path.exists("requirements.txt") +@pytest.mark.network @pytest.mark.parametrize( ("options", "expected_output_file"), ( @@ -96,20 +85,10 @@ def test_command_line_setuptools_read(make_pip_conf, runner): (["setup.py", "--output-file", "output.txt"], "output.txt"), ), ) -def test_command_line_setuptools_output_file( - make_pip_conf, runner, options, expected_output_file -): +def test_command_line_setuptools_output_file(runner, options, expected_output_file): """ Test the output files for setup.py as a requirement file. """ - make_pip_conf( - dedent( - f"""\ - [global] - find-links = {MINIMAL_WHEELS_PATH} - """ - ) - ) with open("setup.py", "w") as package: package.write( @@ -126,7 +105,8 @@ def test_command_line_setuptools_output_file( assert os.path.exists(expected_output_file) -def test_command_line_setuptools_nested_output_file(pip_conf, tmpdir, runner): +@pytest.mark.network +def test_command_line_setuptools_nested_output_file(tmpdir, runner): """ Test the output file for setup.py in nested folder as a requirement file. """