Skip to content

Commit c53fefb

Browse files
committed
session/test_env_select: Reformat from tox -e fix
I find this makes the tests significantly less readable, so I'm commiting this separately so we can decide what to do about it. The options are: 1. Squash this with the previous, just using the auto-enforced formatting. 2. Leave these commits as-is, so we at least can go back to the more readable original formatting. 3. Do whatever needs to be done to keep the auto-reformatter from touching that particular bit of code. I have a preference for 3, but won't argue any other decision.
1 parent 9f44bf3 commit c53fefb

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

tests/session/test_env_select.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,26 @@
1717

1818

1919
@pytest.mark.parametrize(
20-
("user_input", "env_names", "is_all", "is_default" ), [
21-
(None, (), False, True ),
22-
("", (), False, True ),
23-
("a1", ("a1",), False, False ),
24-
("a1,b2,c3", ("a1", "b2", "c3"), False, False ),
25-
# If the user gives "ALL" as any envname, this becomes an "is_all" and other envnames are ignored.
26-
("ALL", (), True, False ),
27-
("a1,ALL,b2", (), True, False ),
28-
# Zero-length envnames are ignored as being not present. This is not intentional.
29-
(",,a1,,,b2,,", ("a1", "b2"), False, False ),
30-
(",,", (), False, True ),
31-
# Environment names with "invalid" characters are accepted here; the client is expected to deal with this.
32-
("\x01.-@\x02,xxx", ("\x01.-@\x02", "xxx"), False, False ),
20+
("user_input", "env_names", "is_all", "is_default"),
21+
[
22+
(None, (), False, True),
23+
("", (), False, True),
24+
("a1", ("a1",), False, False),
25+
("a1,b2,c3", ("a1", "b2", "c3"), False, False),
26+
# If the user gives "ALL" as any envname, this becomes an "is_all" and other envnames are ignored.
27+
("ALL", (), True, False),
28+
("a1,ALL,b2", (), True, False),
29+
# Zero-length envnames are ignored as being not present. This is not intentional.
30+
(",,a1,,,b2,,", ("a1", "b2"), False, False),
31+
(",,", (), False, True),
32+
# Environment names with "invalid" characters are accepted here; the client is expected to deal with this.
33+
("\x01.-@\x02,xxx", ("\x01.-@\x02", "xxx"), False, False),
3334
],
3435
)
3536
def test_clienv(user_input: str, env_names: tuple[str], is_all: bool, is_default: bool) -> None:
3637
ce = CliEnv(user_input)
37-
assert (ce.is_all, ce.is_default_list, tuple(ce)) \
38-
== (is_all, is_default, tuple(env_names))
38+
assert (ce.is_all, ce.is_default_list, tuple(ce)) == (is_all, is_default, tuple(env_names))
39+
3940

4041
@pytest.mark.parametrize(
4142
("user_input", "expected"),

0 commit comments

Comments
 (0)