Skip to content

Commit 42dc22a

Browse files
author
Blanca Fuentes Monjas
committed
Fix tests
1 parent 4844ac3 commit 42dc22a

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

reframe/core/schedulers/slurm.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -734,11 +734,10 @@ def satisfies(self, slurm_constraint: str):
734734
for grp in re.finditer(r'(\w(\w|\d)*)', slurm_constraint)}
735735
slurm_constraint = slurm_constraint.replace(
736736
"&", " and ").replace("|", " or ")
737-
expr = " ".join([f"vars['{key}']" if key not in [
738-
'and', 'or'
739-
] else key
740-
for key in slurm_constraint.split()])
741-
737+
# Pattern to extract the variable names
738+
pattern = r'\b(?!and\b|or\b)(\d*[a-zA-Z_]\w*)\b'
739+
# Replace each variable with var['variable']
740+
expr = re.sub(pattern, r"vars['\1']", slurm_constraint)
742741
vars = {n: True for n in self.active_features}
743742
vars.update({n: False for n in names - self.active_features})
744743
try:

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ archspec==0.2.5
22
argcomplete==3.1.2; python_version < '3.8'
33
argcomplete==3.5.1; python_version >= '3.8'
44
autopep8==2.0.4
5-
autopep8==2.0.4
65
filelock==3.4.1; python_version == '3.6'
76
filelock==3.12.2; python_version == '3.7'
87
filelock==3.16.1; python_version >= '3.8'

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ install_requires =
2929
archspec >= 0.2.4
3030
argcomplete
3131
argcomplete <= 3.1.2; python_version < '3.8'
32+
autopep8
3233
filelock
3334
filelock<=3.12.2; python_version == '3.7'
3435
filelock<=3.4.1; python_version == '3.6'

0 commit comments

Comments
 (0)