|
def | _test_examples_dir (self, str path_to_glob, Optional[List[str]] broken=None, Optional[List[str]] additional_arguments=None, Optional[List[str]] expensive_tests=None, Optional[List[str]] skip_in_light=None) |
|
Test steering files
Definition at line 40 of file steering_files.py.
◆ _test_examples_dir()
def _test_examples_dir |
( |
|
self, |
|
|
str |
path_to_glob, |
|
|
Optional[List[str]] |
broken = None , |
|
|
Optional[List[str]] |
additional_arguments = None , |
|
|
Optional[List[str]] |
expensive_tests = None , |
|
|
Optional[List[str]] |
skip_in_light = None |
|
) |
| |
|
private |
Internal function to test a directory full of example scripts with an
optional list of broken scripts to be skipped.
Parameters:
path_to_glob (str): the path to a directory to search for python
scripts (must end in .py)
broken (list(str)): (optional) names of scripts that are known to
be broken and can be skipped
additional_arguments (list(str)): (optional) additional arguments
for basf2 to be passed when testing the scripts
expensive_tests (list(str)): (optional) names of scripts that take
longer and should e.g. not run on bamboo
skip_in_light (list(str)): (optional) names of scripts that have to
be excluded in light builds
Definition at line 43 of file steering_files.py.
52 Internal function to test a directory full of example scripts with an
53 optional list of broken scripts to be skipped.
56 path_to_glob (str): the path to a directory to search for python
57 scripts (must end in .py)
58 broken (list(str)): (optional) names of scripts that are known to
59 be broken and can be skipped
60 additional_arguments (list(str)): (optional) additional arguments
61 for basf2 to be passed when testing the scripts
62 expensive_tests (list(str)): (optional) names of scripts that take
63 longer and should e.g. not run on bamboo
64 skip_in_light (list(str)): (optional) names of scripts that have to
65 be excluded in light builds
67 if additional_arguments
is None:
68 additional_arguments = []
71 if expensive_tests
is None:
73 if skip_in_light
is None:
78 original_dir = find_file(path_to_glob)
79 working_dir = find_file(shutil.copytree(original_dir,
'working_dir'))
80 all_egs = sorted(glob.glob(working_dir +
"/*.py"))
82 filename = os.path.basename(eg)
83 if filename
in broken:
85 if is_ci()
and filename
in expensive_tests:
87 if light_release()
and filename
in skip_in_light:
89 with self.subTest(msg=filename):
90 result = subprocess.run(
91 [
"basf2",
"-n1", eg, *additional_arguments],
92 stdout=subprocess.PIPE,
93 stderr=subprocess.STDOUT,
96 if result.returncode != 0:
100 sys.stdout.buffer.write(result.stdout)
101 self.assertEqual(result.returncode, 0)
◆ test_lessons_1_to_5()
def test_lessons_1_to_5 |
( |
|
self | ) |
|
The documentation for this class was generated from the following file: