Skip to content

Commit 93ca17b

Browse files
author
Vasileios Karakasis
committed
Fix unit tests using modules systems
Plus some minor fine tuning of code style.
1 parent 5340b83 commit 93ca17b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

reframe/core/schedulers/slurm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ def completion_time(self, job):
103103
not slurm_state_completed(job.state)):
104104
return self._completion_time
105105

106-
with env.temp_environment(
107-
variables=[('SLURM_TIME_FORMAT', 'standard')]):
106+
with env.temp_environment(variables={'SLURM_TIME_FORMAT': 'standard'}):
108107
completed = os_ext.run_command(
109108
'sacct -S %s -P -j %s -o jobid,end' %
110109
(datetime.now().strftime('%F'), job.jobid),

unittests/test_environments.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ def test_load_restore(self):
8989
assert not self.environ.is_loaded
9090

9191
@fixtures.switch_to_user_runtime
92-
def test_temp_environment_context_manager(self):
93-
with env.temp_environment(['testmod_foo'],
94-
[('_var0', 'val2'),
95-
('_var3', 'val3')]) as environ:
92+
def test_temp_environment(self):
93+
self.setup_modules_system()
94+
with env.temp_environment(
95+
['testmod_foo'], {'_var0': 'val2', '_var3': 'val3'}
96+
) as environ:
9697
assert environ.is_loaded
9798

9899
assert not environ.is_loaded

0 commit comments

Comments
 (0)