Skip to content

Commit

Permalink
fix (console.commands.test_init): use app to get InitCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
finswimmer committed Sep 27, 2020
1 parent 49ac15d commit cddbcad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
5 changes: 3 additions & 2 deletions tests/console/commands/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,9 @@ def test_predefined_and_interactive_dev_dependencies(tester, repo):
assert 'pytest = "^3.6.0"' in output


def test_add_package_with_extras_and_whitespace(init_command):
result = init_command._parse_requirements(["databases[postgresql, sqlite]"])
def test_add_package_with_extras_and_whitespace(app):
command = app.find("init")
result = command._parse_requirements(["databases[postgresql, sqlite]"])

assert result[0]["name"] == "databases"
assert len(result[0]["extras"]) == 2
Expand Down
8 changes: 0 additions & 8 deletions tests/console/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from cleo import ApplicationTester

from poetry.console.commands import InitCommand
from poetry.factory import Factory
from poetry.installation.noop_installer import NoopInstaller
from poetry.io.null_io import NullIO
Expand Down Expand Up @@ -114,10 +113,3 @@ def new_installer_disabled(config):
@pytest.fixture()
def executor(poetry, config, env):
return TestExecutor(env, poetry.pool, config, NullIO())


@pytest.fixture()
def init_command(app):
command = InitCommand()
command._application = app
return command

0 comments on commit cddbcad

Please # to comment.