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

Relates-to: #3155 converting duplicated code to fixture #3175

Merged
merged 3 commits into from
Oct 12, 2020
Merged
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
28 changes: 12 additions & 16 deletions tests/console/commands/debug/test_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ def tester(command_tester_factory):
return command_tester_factory("debug resolve")


def test_debug_resolve_gives_resolution_results(tester, repo):
cachy2 = get_package("cachy", "0.2.0")
cachy2.add_dependency(Factory.create_dependency("msgpack-python", ">=0.5 <0.6"))
@pytest.fixture(autouse=True)
def __add_packages(repo):
cachy020 = get_package("cachy", "0.2.0")
cachy020.add_dependency(Factory.create_dependency("msgpack-python", ">=0.5 <0.6"))

repo.add_package(get_package("cachy", "0.1.0"))
repo.add_package(cachy2)
repo.add_package(cachy020)
repo.add_package(get_package("msgpack-python", "0.5.3"))

repo.add_package(get_package("pendulum", "2.0.3"))
repo.add_package(get_package("cleo", "0.6.5"))


def test_debug_resolve_gives_resolution_results(tester):
tester.execute("cachy")

expected = """\
Expand All @@ -31,14 +37,7 @@ def test_debug_resolve_gives_resolution_results(tester, repo):
assert expected == tester.io.fetch_output()


def test_debug_resolve_tree_option_gives_the_dependency_tree(tester, repo):
cachy2 = get_package("cachy", "0.2.0")
cachy2.add_dependency(Factory.create_dependency("msgpack-python", ">=0.5 <0.6"))

repo.add_package(get_package("cachy", "0.1.0"))
repo.add_package(cachy2)
repo.add_package(get_package("msgpack-python", "0.5.3"))

def test_debug_resolve_tree_option_gives_the_dependency_tree(tester):
tester.execute("cachy --tree")

expected = """\
Expand All @@ -53,10 +52,7 @@ def test_debug_resolve_tree_option_gives_the_dependency_tree(tester, repo):
assert expected == tester.io.fetch_output()


def test_debug_resolve_git_dependency(tester, repo):
repo.add_package(get_package("pendulum", "2.0.3"))
repo.add_package(get_package("cleo", "0.6.5"))

def test_debug_resolve_git_dependency(tester):
tester.execute("git+https://github.com/demo/demo.git")

expected = """\
Expand Down