Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
atugushev committed Mar 1, 2021
1 parent 049acd8 commit 4661c89
Showing 1 changed file with 10 additions and 30 deletions.
40 changes: 10 additions & 30 deletions tests/test_cli_compile.py
Expand Up @@ -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(
Expand All @@ -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)
"""
Expand All @@ -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"),
(
Expand All @@ -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(
Expand All @@ -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.
"""
Expand Down

0 comments on commit 4661c89

Please sign in to comment.