diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-03 00:20:48 -0400 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-04 04:04:11 -0400 |
commit | d96f799298f2db8b0ad49ef99c9a9a0bc5493348 (patch) | |
tree | 9c64c72175578f88f29ff137e98d6dbe96e85ff3 | |
parent | af433395a27c9e29d2a5954a29acb6c77e5490fc (diff) | |
download | buildstream-d96f799298f2db8b0ad49ef99c9a9a0bc5493348.tar.gz |
tests/frontend/help.py: Use the fixture to run buildstream
-rw-r--r-- | tests/frontend/help.py | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/tests/frontend/help.py b/tests/frontend/help.py index a38125f77..7eb017c2e 100644 --- a/tests/frontend/help.py +++ b/tests/frontend/help.py @@ -1,8 +1,5 @@ -from click.testing import CliRunner import pytest - -# Import the main cli entrypoint -from buildstream._frontend.main import cli +from tests.testutils.runcli import cli def assert_help(cli_output): @@ -14,13 +11,8 @@ def assert_help(cli_output): .format(cli_output)) -@pytest.fixture(scope="module") -def runner(): - return CliRunner() - - -def test_help_main(runner): - result = runner.invoke(cli, ['--help']) +def test_help_main(cli): + result = cli.run(args=['--help']) assert result.exit_code == 0 assert_help(result.output) @@ -37,7 +29,7 @@ def test_help_main(runner): ('track'), ('workspace') ]) -def test_help(runner, command): - result = runner.invoke(cli, [command, '--help']) +def test_help(cli, command): + result = cli.run(args=[command, '--help']) assert result.exit_code == 0 assert_help(result.output) |