Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Jun 9, 2021
1 parent c3752e1 commit cbee456
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
30 changes: 18 additions & 12 deletions tests/test_cli_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,10 @@ def test_generate_hashes_with_annotations(runner):

out = runner.invoke(cli, ["--generate-hashes"])
assert out.stderr == dedent(
"""\
f"""\
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python \
{sys.version_info.major}.{sys.version_info.minor}
# To update, run:
#
# pip-compile --generate-hashes
Expand All @@ -835,9 +836,10 @@ def test_generate_hashes_with_long_annotations(runner):

out = runner.invoke(cli, ["--generate-hashes"])
assert out.stderr == dedent(
"""\
f"""\
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python \
{sys.version_info.major}.{sys.version_info.minor}
# To update, run:
#
# pip-compile --generate-hashes
Expand Down Expand Up @@ -976,9 +978,10 @@ def test_stdin(pip_conf, runner):
)

assert out.stderr == dedent(
"""\
f"""\
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python \
{sys.version_info.major}.{sys.version_info.minor}
# To update, run:
#
# pip-compile --no-emit-find-links --output-file=requirements.txt -
Expand Down Expand Up @@ -1013,9 +1016,10 @@ def test_multiple_input_files_without_output_file(runner):
(
pytest.param(
"--annotate",
"""\
f"""\
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python \
{sys.version_info.major}.{sys.version_info.minor}
# To update, run:
#
# pip-compile --no-emit-find-links
Expand All @@ -1032,9 +1036,10 @@ def test_multiple_input_files_without_output_file(runner):
),
pytest.param(
"--no-annotate",
"""\
f"""\
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python \
{sys.version_info.major}.{sys.version_info.minor}
# To update, run:
#
# pip-compile --no-annotate --no-emit-find-links
Expand Down Expand Up @@ -1278,9 +1283,10 @@ def test_upgrade_package_doesnt_remove_annotation(pip_conf, runner):
runner.invoke(cli, ["-P", "small-fake-a", "--no-emit-find-links"])
with open("requirements.txt") as req_txt:
assert req_txt.read() == dedent(
"""\
f"""\
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python \
{sys.version_info.major}.{sys.version_info.minor}
# To update, run:
#
# pip-compile --no-emit-find-links
Expand Down
8 changes: 6 additions & 2 deletions tests/test_writer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

import pytest
from pip._internal.models.format_control import FormatControl

Expand Down Expand Up @@ -184,7 +186,8 @@ def test_write_header(writer):
comment,
[
"#",
"# This file is autogenerated by pip-compile",
"# This file is autogenerated by pip-compile with python "
f"{sys.version_info.major}.{sys.version_info.minor}",
"# To update, run:",
"#",
"# pip-compile --output-file={} src_file src_file2".format(
Expand All @@ -202,7 +205,8 @@ def test_write_header_custom_compile_command(writer, monkeypatch):
comment,
[
"#",
"# This file is autogenerated by pip-compile",
"# This file is autogenerated by pip-compile with python "
f"{sys.version_info.major}.{sys.version_info.minor}",
"# To update, run:",
"#",
"# ./pipcompilewrapper",
Expand Down

0 comments on commit cbee456

Please sign in to comment.