Skip to content

Commit 7eaebeb

Browse files
committed
test: fix test paddings to pass linter in CI
1 parent 2522490 commit 7eaebeb

File tree

12 files changed

+134
-136
lines changed

12 files changed

+134
-136
lines changed

doc/source/testing/testLauncher.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ By default, the alphabetical order will be used.
302302
When clauses
303303
------------
304304

305-
You can also dynamically override a specific value when a parameter value is selected,
306-
it simplified the writting of some conditions like if you used and IF statement.
305+
You can also dynamically override a specific value when a parameter value is selected.
306+
It is just like if you used and IF statement.
307307

308308
.. code-block:: json
309309

pytools/idfx_test.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import sys
66
import re
77
import json
8-
import pytest
9-
import warnings
108

119
import numpy as np
1210
import matplotlib.pyplot as plt
@@ -105,11 +103,11 @@ def __init__ (self, current_test_file, name=""):
105103
parser.add_argument("-ccache",
106104
help="Use ccache to reduce the build time over multiple run of the test suite.",
107105
action="store_true")
108-
106+
109107
parser.add_argument("-restart",
110108
help="Enable creating a restart from a checkpoint.",
111109
action='store_true')
112-
110+
113111
parser.add_argument("-v", "--verbose",
114112
help="Enable verbose mode, by not capturing the output.",
115113
action="store_true")
@@ -145,20 +143,20 @@ def __init__ (self, current_test_file, name=""):
145143
self.lastCmakeCmd=""
146144
# subdir
147145
self.filterSubdir=args.subdir
148-
# save
146+
# save
149147
self.cmdArgs = vars(args)
150148
self.cmdArgs.update({
151149
"restart_no_overwrite": [],
152150
})
153151
self.log=[]
154152
# when making a restart we should not overrite those files (will be checked)
155153
self.restart_no_overwrite=[]
156-
154+
157155
# forward args for pytest
158156
if args.verbose:
159-
unknown.append("--capture=no")
157+
unknown.append("--capture=no")
160158
if args.help_pytest:
161-
unknown.append("--help")
159+
unknown.append("--help")
162160
# remaining args
163161
self.remainingArgs=unknown
164162

@@ -178,7 +176,7 @@ def applyConfig(self, config: dict={}):
178176
newArgs = {}
179177
newArgs.update(self.cmdArgs)
180178
newArgs.update(config)
181-
179+
182180
# replace in dict
183181
self.__dict__.update(newArgs)
184182

pytools/idfx_test_gen.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, currentTestFile: str, name: str = ""):
2121
Constructor or the class.
2222
2323
Args:
24-
currentTestFile (str):
24+
currentTestFile (str):
2525
Path the the current python file. Normally you
2626
simply pass __file__ to this parameter.
2727
name (str):
@@ -55,7 +55,7 @@ def genTestConfigs(self, names:str, params, whenClauses = {}) -> list:
5555
# get name ordering list
5656
nameList = names.split(',')
5757

58-
# gen list of complete configs
58+
# gen list of complete configs
5959
all_configs = []
6060
if isinstance(params, dict):
6161
all_configs += self._genOneConfigSeries(names, params)
@@ -64,7 +64,7 @@ def genTestConfigs(self, names:str, params, whenClauses = {}) -> list:
6464
all_configs += self._genOneConfigSeries(names, p)
6565
else:
6666
raise Exception("Should never be called !")
67-
67+
6868
# convert as parametrize with nice name
6969
result = []
7070
for config in all_configs:
@@ -98,7 +98,7 @@ def extractNamingParameters(self, params) -> list:
9898
Args:
9999
params (list|dict):
100100
The list of configuration sets to scan or a single set.
101-
101+
102102
Returns:
103103
The list of names of the variable parameters.
104104
'''
@@ -129,7 +129,7 @@ def extractNamingParameters(self, params) -> list:
129129
# TODO make something better by assigning a priority to vars
130130
variables.sort()
131131

132-
# ok
132+
# ok
133133
return ','.join(variables)
134134

135135
def _genNextLevelCombinations(self, input: list, paramName: str, paramValues: list) -> list:
@@ -139,7 +139,7 @@ def _genNextLevelCombinations(self, input: list, paramName: str, paramValues: li
139139
Args:
140140
input (list):
141141
The incoming list of combinations already unpacked before this call.
142-
paramName (str):
142+
paramName (str):
143143
Name of the parameter to unpack.
144144
paramValues (list):
145145
The list of values to unpack and to build combinations for.

pytools/idfx_test_run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def _makeVariableArgAsList(self, namings: str, variants) -> list:
5555
# split namings
5656
namings = namings.split(",")
5757

58-
# loop on each
58+
# loop on each
5959
for variant in variants:
6060
for name in namings:
6161
if name in variant and isinstance(variant[name], list) == False:
@@ -101,10 +101,10 @@ def genTests(self) -> list:
101101
result += idefixTestGenerator.genTestConfigs(namings, test['variants'], test.get('when', {}))
102102
except Exception as e:
103103
raise Exception(f"Fail to generate tests from {testfileRelPath} : {e}")
104-
104+
105105
# ok
106106
return result
107-
107+
108108
def run(self, config: dict) -> None:
109109
# clone before modify to not modity for caller
110110
config = copy.deepcopy(config)

pytools/tests/test/pb1/testme.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"variants": [
3-
{
4-
"dumpname": "dump.0001.dmp",
5-
"ini": ["idefix.ini","idefix-implicit.ini"],
6-
"noplot": true,
7-
"reconstruction": 2,
8-
"tolerance": 1e-14
9-
}
10-
]
2+
"variants": [
3+
{
4+
"dumpname": "dump.0001.dmp",
5+
"ini": ["idefix.ini","idefix-implicit.ini"],
6+
"noplot": true,
7+
"reconstruction": 2,
8+
"tolerance": 1e-14
9+
}
10+
]
1111
}

pytools/tests/test/pb2/testme.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
2-
"variants": [
3-
{
4-
"dumpname": "dump.0001.dmp",
5-
"ini": ["idefix.ini","idefix-implicit.ini"],
6-
"noplot": true,
7-
"reconstruction": 2,
8-
"tolerance": 1e-14
9-
},
10-
{
11-
"dumpname": "dump.0001.dmp",
12-
"ini": ["idefix.ini","idefix-implicit.ini"],
13-
"noplot": false,
14-
"reconstruction": 2,
15-
"tolerance": 1e-14
16-
}
17-
]
2+
"variants": [
3+
{
4+
"dumpname": "dump.0001.dmp",
5+
"ini": ["idefix.ini","idefix-implicit.ini"],
6+
"noplot": true,
7+
"reconstruction": 2,
8+
"tolerance": 1e-14
9+
},
10+
{
11+
"dumpname": "dump.0001.dmp",
12+
"ini": ["idefix.ini","idefix-implicit.ini"],
13+
"noplot": false,
14+
"reconstruction": 2,
15+
"tolerance": 1e-14
16+
}
17+
]
1818
}

test/Dust/DustEnergy/testme.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"namings": "ini",
3-
"variants": [
4-
{
5-
"dumpname": "dump.0001.dmp",
6-
"ini": ["idefix.ini","idefix-implicit.ini"],
7-
"noplot": true,
8-
"reconstruction": 2,
9-
"tolerance": 0
10-
}
11-
]
2+
"namings": "ini",
3+
"variants": [
4+
{
5+
"dumpname": "dump.0001.dmp",
6+
"ini": ["idefix.ini","idefix-implicit.ini"],
7+
"noplot": true,
8+
"reconstruction": 2,
9+
"tolerance": 0
10+
}
11+
]
1212
}

test/Dust/DustyShock/testme.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"variants": [
3-
{
4-
"dumpname": "dump.0001.dmp",
5-
"ini": ["idefix.ini","idefix-implicit.ini"],
6-
"noplot": true,
7-
"reconstruction": 2,
8-
"tolerance": 1e-14
9-
}
10-
]
2+
"variants": [
3+
{
4+
"dumpname": "dump.0001.dmp",
5+
"ini": ["idefix.ini","idefix-implicit.ini"],
6+
"noplot": true,
7+
"reconstruction": 2,
8+
"tolerance": 1e-14
9+
}
10+
]
1111
}

test/Dust/DustyWave/testme.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"namings": "ini",
3-
"variants": [
4-
{
5-
"dumpname": "dump.0001.dmp",
6-
"ini": ["idefix.ini","idefix-implicit.ini"],
7-
"noplot": true,
8-
"reconstruction": 2,
9-
"tolerance": 1e-14
10-
}
11-
]
2+
"namings": "ini",
3+
"variants": [
4+
{
5+
"dumpname": "dump.0001.dmp",
6+
"ini": ["idefix.ini","idefix-implicit.ini"],
7+
"noplot": true,
8+
"reconstruction": 2,
9+
"tolerance": 1e-14
10+
}
11+
]
1212
}

test/HD/FargoPlanet/testme.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
2-
"namings": "ini,mpi",
3-
"variants": [
4-
{
5-
"dumpname": "dump.0001.dmp",
6-
"ini": ["idefix.ini", "idefix-rkl.ini"],
7-
"noplot": true,
8-
"reconstruction": 2,
9-
"single": false,
10-
"mpi": [false, true],
11-
"dec": [2, 2],
12-
"tolerance": 1e-13
13-
}
14-
],
15-
"when": [
16-
{
17-
"conditions": {
18-
"ini": "idefix-rkl.ini"
19-
},
20-
"apply": {
21-
"tolerance": 1e-12
22-
}
23-
}
24-
]
2+
"namings": "ini,mpi",
3+
"variants": [
4+
{
5+
"dumpname": "dump.0001.dmp",
6+
"ini": ["idefix.ini", "idefix-rkl.ini"],
7+
"noplot": true,
8+
"reconstruction": 2,
9+
"single": false,
10+
"mpi": [false, true],
11+
"dec": [2, 2],
12+
"tolerance": 1e-13
13+
}
14+
],
15+
"when": [
16+
{
17+
"conditions": {
18+
"ini": "idefix-rkl.ini"
19+
},
20+
"apply": {
21+
"tolerance": 1e-12
22+
}
23+
}
24+
]
2525
}

0 commit comments

Comments
 (0)