@@ -30,14 +30,14 @@ def find_testfiles():
30
30
31
31
32
32
def from_yaml ():
33
- """Determins how often each test file is run per platform and floatX setting.
33
+ """Determines how often each test file is run per platform and floatX setting.
34
34
35
35
An exception is raised if tests run multiple times with the same configuration.
36
36
"""
37
37
# First collect the matrix definitions from testing workflows
38
38
matrices = {}
39
39
for wf in ["tests.yml" ]:
40
- wfname = wf .strip (".yml" )
40
+ wfname = wf .rstrip (".yml" )
41
41
wfdef = yaml .safe_load (open (Path (".github" , "workflows" , wf )))
42
42
for jobname , jobdef in wfdef ["jobs" ].items ():
43
43
matrix = jobdef .get ("strategy" , {}).get ("matrix" , {})
@@ -74,22 +74,21 @@ def from_yaml():
74
74
# Windows jobs need \ in line breaks within the test-subset!
75
75
# The following checks that these trailing \ are present in
76
76
# all items except the last.
77
- nlines = len (lines )
78
- for l , line in enumerate (lines ):
79
- if l < nlines - 1 and not line .endswith (" \\ " ):
77
+ if lines and lines [- 1 ].endswith (" \\ " ):
78
+ raise Exception (
79
+ f"Last entry '{ line } ' in Windows test subset should end WITHOUT ' \\ '."
80
+ )
81
+ for line in lines [:- 1 ]:
82
+ if not line .endswith (" \\ " ):
80
83
raise Exception (f"Missing ' \\ ' after '{ line } ' in Windows test-subset." )
81
- elif l == nlines - 1 and line .endswith (" \\ " ):
82
- raise Exception (
83
- f"Last entry '{ line } ' in Windows test subset should end WITHOUT ' \\ '."
84
- )
85
- testfiles [l ] = line .strip (" \\ " )
84
+ lines = [line .rstrip (" \\ " ) for line in lines ]
86
85
87
86
# Unpack lines with >1 item
88
87
testfiles = []
89
88
for line in lines :
90
89
testfiles += line .split (" " )
91
90
92
- ignored = {item . strip ( "--ignore =" ) for item in testfiles if item .startswith ("--ignore" )}
91
+ ignored = {item [ 8 :]. lstrip ( " =" ) for item in testfiles if item .startswith ("--ignore" )}
93
92
included = {item for item in testfiles if item and not item .startswith ("--ignore" )}
94
93
95
94
if ignored and not included :
0 commit comments