idaes.util.testutil module
Utility functions, etc. for testing
-
class
idaes.util.testutil.
RunnableExample
(path)[source]
Bases: object
Encapsulate a runnable example script.
Example usage (e.g. in a test):
ex = RunnableExample(“dmf/resource_example.py”)
rcode = ex.run(timeout=5)
assert rcode == 0, “dmf/resource_example.py failed”
-
ansi_escape
= re.compile('\\x1B\\[[0-?]*[ -/]*[@-~]')
-
error
-
output
-
run
(args=None, timeout=15)[source]
Run the example.
- Files ending in ‘.py’ are run with the Python interpreter.
- Files ending in ‘.ipynb’ (Jupyter notebooks) are executed using
Jupyter nbconvert’s pre-processing API.
- All other files are simply executed.
Parameters: |
- args (list[str]) – Arguments passed to scripts (except notebooks)
- timeout (int) – Time, in seconds, to wait for it to run.
|
Returns: | Numeric status code
|
-
idaes.util.testutil.
examples_path
()[source]
Return path to examples directory.
-
idaes.util.testutil.
find_examples
(subdir)[source]