Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup tests #24

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/cli/test_cli_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_clean(rye_project):
assert not folder.exists()

assert result.exit_code == 0
assert result.output.__contains__("The whole project was cleaned.")
assert "The whole project was cleaned." in result.output


@pytest.mark.parametrize(
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_clean_folder(rye_project, option):
assert folder.exists()

assert result.exit_code == 0
assert result.output.__contains__(f"Folder(s) {folder_name} cleaned.")
assert f"Folder(s) {folder_name} cleaned." in result.output


def test_clean_multiple_folders(rye_project):
Expand All @@ -106,7 +106,7 @@ def test_clean_multiple_folders(rye_project):
assert build.exists()

assert result.exit_code == 0
assert result.output.__contains__("Folder(s) dist, target cleaned.")
assert "Folder(s) dist, target cleaned." in result.output


@pytest.mark.parametrize("init_folder", [True, False])
Expand Down
4 changes: 2 additions & 2 deletions tests/cli/test_cli_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def test_pyproject_does_not_exist():
with runner.isolated_filesystem():
result = runner.invoke(cli, ["init", "-q"])
assert result.exit_code != 0
assert result.output.__contains__("No pyproject.toml file found")
assert "No pyproject.toml file found" in result.output


def test_pyproject_invalid_toml(tmp_path_chdir):
Expand All @@ -187,4 +187,4 @@ def test_pyproject_invalid_toml(tmp_path_chdir):
runner = CliRunner()
result = runner.invoke(cli, ["init", "-q"])
assert result.exit_code != 0
assert result.output.__contains__("Invalid `pyproject.toml` file")
assert "Invalid `pyproject.toml` file" in result.output
6 changes: 3 additions & 3 deletions tests/func/test_packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test_get_pyapp_no_file_found(rye_project, mocker):
with pytest.raises(click.ClickException) as e:
packager._get_pyapp()

assert e.value.args[0].__contains__("Error: no pyapp source code found")
assert "Error: no pyapp source code found" in e.value.args[0]
url_mock.assert_called_with(PYAPP_SOURCE, Path("pyapp-source.tar.gz"))


Expand Down Expand Up @@ -166,14 +166,14 @@ def test_get_pyapp_wrong_no_pyapp_folder(rye_project, mocker):
with pytest.raises(click.ClickException) as e:
packager._get_pyapp()

assert e.value.args[0].__contains__("Error: no pyapp source code found")
assert "Error: no pyapp source code found" in e.value.args[0]

rye_project.joinpath("build/pyapp-source.tar.gz").touch()

with pytest.raises(click.ClickException) as e:
packager._get_pyapp()

assert e.value.args[0].__contains__("Error: no pyapp source code folder found.")
assert "Error: no pyapp source code folder found." in e.value.args[0]


def test_get_pyapp_local_wrong_file(rye_project):
Expand Down
Loading