Skip to content

Commit c8ceb0a

Browse files
committed
[test] Use config.args.add_if_not_set instead of manual mark_set
1 parent 2850a4e commit c8ceb0a

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

bin/config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,6 @@ def add_if_not_set(self, args: "ARGS") -> None:
278278
setattr(self, key, getattr(args, key))
279279
self._set.add(key)
280280

281-
def mark_set(self, *keys: str) -> None:
282-
self._set.update(list(keys))
283-
284281
def copy(self) -> "ARGS":
285282
res = copy.copy(self)
286283
res._set = copy.copy(res._set)

test/test_default_output_validator.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
# Note: the python version isn't tested by default, because it's quite slow.
1616
DEFAULT_OUTPUT_VALIDATOR = ["default_output_validator.cpp"]
1717

18-
config.args.verbose = 2
19-
config.args.error = True
20-
config.args.mark_set("verbose", "error")
18+
config.args.add_if_not_set(config.ARGS("test_default_output_validator.py", verbose=2, error=True))
2119

2220

2321
# return list of (flags, ans, out, expected result)

test/test_problem_yaml.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
RUN_DIR = Path.cwd().absolute()
1111

12-
config.args.verbose = 2
13-
config.args.error = True
14-
config.args.mark_set("verbose", "error")
12+
config.args.add_if_not_set(config.ARGS("test_problem_yaml.py", verbose=2, error=True))
1513

1614

1715
# return list of {yaml: {...}, ...} documents

0 commit comments

Comments
 (0)