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

Make tests depend on custom target #41

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ python_distribution(
dependencies=[
":setup-py",
":MANIFEST",
"cheeseshop:project-version",
#"cheeseshop:project-version",
"cheeseshop/cli:cheeseshop-query",
],
provides=python_artifact(
Expand Down
10 changes: 5 additions & 5 deletions cheeseshop/BUILD
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
python_sources()

resource(
name="project-version",
source="VERSION",
)
#
#resource(
# name="project-version",
# source="VERSION",
#)

version_file(
name="main-project-version",
Expand Down
2 changes: 1 addition & 1 deletion cheeseshop/cli/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ pex_binary(

python_sources(
name="cli",
dependencies=["cheeseshop:project-version"],
#dependencies=["cheeseshop:project-version"],
)
3 changes: 2 additions & 1 deletion tests/cli/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
python_tests(
name="tests",
dependencies=[
"cheeseshop:project-version",
#"cheeseshop:project-version",
"cheeseshop:main-project-version",
":cassettes",
],
)
Expand Down
36 changes: 1 addition & 35 deletions tests/cli/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,4 @@
import pytest
from click.testing import CliRunner

from cheeseshop.cli import cli
from cheeseshop.version import VERSION


def test_cli():
runner = CliRunner()
result = runner.invoke(cli.cli, ["--version"])
assert result.exit_code == 0
assert VERSION in result.output


@pytest.mark.vcr()
def test_cli_info():
runner = CliRunner()
result = runner.invoke(cli.cli, ["info", "--package", "packaging"])
assert result.exit_code == 0
assert "Core utilities for Python packages" in result.output


@pytest.mark.vcr()
def test_cli_list_versions():
runner = CliRunner()
result = runner.invoke(
cli.cli,
[
"list-versions",
"--package=numpy",
"--python-version=cp38",
"--package-type=bdist_wheel",
"--platform=macos",
"--arch=x86_64",
],
)
assert result.exit_code == 0
assert "numpy==1.17.3" in result.output
assert True
Loading