Skip to content

Commit 53f0bd2

Browse files
committed
tests: Make test_visible_devices independent of pytest backgroup env
1 parent 1feb2b9 commit 53f0bd2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/test_gpu_common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ def test_visible_devices(self, env_variables):
103103

104104
eq = Eq(u, u+1)
105105

106-
with switchenv(env_variables):
106+
temp_env = dict(env_variables)
107+
other = set(self.visible_device_envs) - set(temp_env)
108+
temp_env.update({i: None for i in other})
109+
110+
with switchenv(temp_env):
107111
op1 = Operator(eq)
108112
argmap1 = op1.arguments()
109113
# All variants in parameterisation should yield deviceid 1

0 commit comments

Comments
 (0)