Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
atugushev committed Aug 8, 2023
1 parent c5b447d commit 9c58530
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/test_cli_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3102,3 +3102,33 @@ def test_invalid_cli_boolean_flag_config_option_captured(

assert out.exit_code == 2
assert "No such config key 'no_annnotate'." in out.stderr


strip_extras_warning = (
"WARNING: --strip-extras is becoming the default in version 8.0.0."
)


def test_show_warning_on_default_strip_extras_option(
runner, make_package, make_sdist, tmp_path
):
req_in = tmp_path / "requirements.in"
req_in.touch()

out = runner.invoke(cli, req_in.as_posix())

assert out.exit_code == 0
assert strip_extras_warning in out.stderr


@pytest.mark.parametrize("option", ("--strip-extras", "--no-strip-extras"))
def test_do_not_show_warning_on_explicit_strip_extras_option(
runner, make_package, make_sdist, tmp_path, option
):
req_in = tmp_path / "requirements.in"
req_in.touch()

out = runner.invoke(cli, [option, req_in.as_posix()])

assert out.exit_code == 0
assert strip_extras_warning not in out.stderr

0 comments on commit 9c58530

Please sign in to comment.