File: conftest.py

package info (click to toggle)
python-cloup 3.0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 936 kB
  • sloc: python: 5,371; makefile: 120
file content (31 lines) | stat: -rw-r--r-- 775 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from functools import partial

from click.testing import CliRunner
from pytest import fixture

from tests.example_command import make_example_command
from tests.example_group import make_example_group


@fixture()
def runner():
    runner = CliRunner()
    runner.invoke = partial(runner.invoke, catch_exceptions=False)
    return runner


@fixture(scope='session')
def get_example_command():
    def get_command(tabular_help=True, align_option_groups=True):
        return make_example_command(
            align_option_groups=align_option_groups, tabular_help=tabular_help)

    return get_command


@fixture(scope='session')
def get_example_group():
    def get_group(align_sections):
        return make_example_group(align_sections=align_sections)

    return get_group