Skip to content

Commit a3e9ac2

Browse files
committed
allow selective refresh of reference files
1 parent 35a3a83 commit a3e9ac2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/refresh_reference_files.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3+
import argparse
34
import os
45
import importlib.util
56

@@ -8,15 +9,18 @@
89

910

1011
def _main():
12+
parser = argparse.ArgumentParser(description='Refresh the reference TeX files.')
13+
parser.add_argument('files', nargs="+", help='Files to refresh')
14+
args = parser.parse_args()
15+
1116
this_dir = os.path.dirname(os.path.abspath(__file__))
1217
exclude_list = ["test_rotated_labels.py", "test_deterministic_output.py"]
13-
for filename in os.listdir(this_dir):
18+
19+
for filename in args.files:
20+
if filename in exclude_list:
21+
continue
1422
if filename.startswith("test_") and filename.endswith(".py"):
1523
spec = importlib.util.spec_from_file_location("plot", filename)
16-
17-
if filename in exclude_list:
18-
continue
19-
2024
module = importlib.util.module_from_spec(spec)
2125
spec.loader.exec_module(module)
2226
module.plot()

0 commit comments

Comments
 (0)