Skip to content

Commit 371cb60

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 485141a commit 371cb60

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
@@ -20,25 +20,26 @@
2020

2121

2222
@pytest.mark.parametrize(
23-
("userinput", "envnames", "isall", "isdefault" ), [
24-
(None, (), False, True ),
25-
("", (), False, True ),
26-
("a1", ("a1",), False, False ),
27-
("a1,b2,c3", ("a1", "b2", "c3"), False, False ),
28-
# If the user gives "ALL" as any envname, this becomes an "is_all" and other envnames are ignored.
29-
("ALL", (), True, False ),
30-
("a1,ALL,b2", (), True, False ),
31-
# Zero-length envnames are ignored as being not present. This is not intentional.
32-
(",,a1,,,b2,,", ("a1", "b2"), False, False ),
33-
(",,", (), False, True ),
34-
# Environment names with "invalid" characters are accepted here; the client is expected to deal with this.
35-
("\x01.-@\x02,xxx", ("\x01.-@\x02", "xxx"), False, False ),
23+
("userinput", "envnames", "isall", "isdefault"),
24+
[
25+
(None, (), False, True),
26+
("", (), False, True),
27+
("a1", ("a1",), False, False),
28+
("a1,b2,c3", ("a1", "b2", "c3"), False, False),
29+
# If the user gives "ALL" as any envname, this becomes an "is_all" and other envnames are ignored.
30+
("ALL", (), True, False),
31+
("a1,ALL,b2", (), True, False),
32+
# Zero-length envnames are ignored as being not present. This is not intentional.
33+
(",,a1,,,b2,,", ("a1", "b2"), False, False),
34+
(",,", (), False, True),
35+
# Environment names with "invalid" characters are accepted here; the client is expected to deal with this.
36+
("\x01.-@\x02,xxx", ("\x01.-@\x02", "xxx"), False, False),
3637
],
3738
)
3839
def test_clienv(userinput: str, envnames: tuple[str], isall: bool, isdefault: bool) -> None:
3940
c = CliEnv(userinput)
40-
assert (c.is_all, c.is_default_list, tuple(c)) \
41-
== (isall, isdefault, tuple(envnames))
41+
assert (c.is_all, c.is_default_list, tuple(c)) == (isall, isdefault, tuple(envnames))
42+
4243

4344
@pytest.mark.parametrize(
4445
("userinput", "expected"),

0 commit comments

Comments
 (0)