Skip to content

Commit ad42073

Browse files
committed
style: remove unused import
- Remove unused pytest import from test_environment.py
1 parent caf6728 commit ad42073

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/test/test_environment.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import os
66
import typing as t
77

8-
import pytest
9-
108
from libtmux.test.environment import EnvironmentVarGuard
119

1210

@@ -116,38 +114,38 @@ def test_environment_var_guard_unset_and_reset() -> None:
116114
def test_environment_var_guard_exit_with_exception() -> None:
117115
"""Test __exit__ method with exception parameters."""
118116
env = EnvironmentVarGuard()
119-
117+
120118
# Set up test variables
121119
os.environ["TEST_VAR"] = "original_value"
122120
env.set("TEST_VAR", "new_value")
123-
121+
124122
# Call __exit__ with exception parameters
125123
env.__exit__(
126-
t.cast(t.Type[BaseException], RuntimeError),
124+
t.cast(type[BaseException], RuntimeError),
127125
RuntimeError("Test exception"),
128126
None,
129127
)
130-
128+
131129
# Verify cleanup still happened
132130
assert os.environ["TEST_VAR"] == "original_value"
133131

134132

135133
def test_environment_var_guard_unset_previously_set() -> None:
136134
"""Test unsetting a variable that was previously set in the same context."""
137135
env = EnvironmentVarGuard()
138-
136+
139137
# Make sure the variable doesn't exist initially
140138
if "TEST_NEW_VAR" in os.environ:
141139
del os.environ["TEST_NEW_VAR"]
142-
140+
143141
# Set a new variable
144142
env.set("TEST_NEW_VAR", "new_value")
145143
assert "TEST_NEW_VAR" in os.environ
146144
assert os.environ["TEST_NEW_VAR"] == "new_value"
147-
145+
148146
# Now unset it - this should hit line 57
149147
env.unset("TEST_NEW_VAR")
150148
assert "TEST_NEW_VAR" not in os.environ
151-
149+
152150
# No need to check after cleanup since the variable was never in the environment
153151
# before we started

0 commit comments

Comments
 (0)