|
def | test_lessons_1_to_5 (self) |
|
Test steering files
Definition at line 18 of file steering_files.py.
◆ _test_examples_dir()
def _test_examples_dir |
( |
|
self, |
|
|
|
path_to_glob, |
|
|
|
broken = None , |
|
|
|
additional_arguments = 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 search for scripts
broken (list(str)): (optional) scripts that are known to be broken
and can be skipped
Definition at line 21 of file steering_files.py.
21 def _test_examples_dir(self, path_to_glob, broken=None, additional_arguments=None):
23 Internal function to test a directory full of example scripts with an
24 optional list of broken scripts to be skipped.
27 path_to_glob (str): the path to search for scripts
28 broken (list(str)): (optional) scripts that are known to be broken
31 if additional_arguments
is None:
32 additional_arguments = []
35 all_egs = sorted(glob.glob(find_file(path_to_glob) +
"/*.py"))
37 filename = os.path.basename(eg)
38 if filename
not in broken:
39 with self.subTest(msg=filename):
40 result = subprocess.run(
41 [
"basf2",
"-n1", eg, *additional_arguments],
42 stdout=subprocess.PIPE,
43 stderr=subprocess.STDOUT,
45 if result.returncode != 0:
49 sys.stdout.buffer.write(result.stdout)
50 self.assertEqual(result.returncode, 0)
The documentation for this class was generated from the following file: