File: test_session_common.py

package info (click to toggle)
tox 4.49.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,612 kB
  • sloc: python: 26,672; javascript: 114; sh: 22; makefile: 15
file content (31 lines) | stat: -rw-r--r-- 689 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 __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