summaryrefslogtreecommitdiff
path: root/tests/session/test_session_common.py
blob: 7d8df6425980e740991feed41c43013f5e24162b (plain)
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 __future__ import annotations

import pytest

from tox.session.env_select import CliEnv


@pytest.mark.parametrize(
    ("val", "exp"),
    [
        (CliEnv(["a", "b"]), "CliEnv('a,b')"),
        (CliEnv(["ALL", "b"]), "CliEnv('ALL')"),
        (CliEnv([]), "CliEnv()"),
        (CliEnv(), "CliEnv()"),
    ],
)
def test_cli_env_repr(val: CliEnv, exp: str) -> None:
    assert repr(val) == exp


@pytest.mark.parametrize(
    ("val", "exp"),
    [
        (CliEnv(["a", "b"]), "a,b"),
        (CliEnv(["ALL", "b"]), "ALL"),
        (CliEnv([]), "<env_list>"),
        (CliEnv(), "<env_list>"),
    ],
)
def test_cli_env_str(val: CliEnv, exp: str) -> None:
    assert str(val) == exp