test framework for OpenFOAM
Project description
test framework for OpenFOAM
Free software: GPLv3 License
Installation
pip install oftest
You can also install the in-development version with:
pip install https://github.com/HenningScheufler/oftest/archive/master.zip
Documentation
Development
To run all the tests run and build the doc:
tox
QuickStart
add conftest.py and pytest.ini to your project
cat pytest.ini:
[pytest] #minversion = 6.0 addopts = -ra -v --import-mode=importlib --tb=no --cache-clear testpaths = tests
cat conftest.py:
import pytest def pytest_addoption(parser): parser.addoption( "--writeNSteps", action="store", default=0, help="only perform specified number of timestep" ) parser.addoption( "--no-clean-up", action='store_false',default=True ,help="do not clean case after run" )
we assume that all OpenFOAM test are located in the tests folder and that each test can be started with a Allrun or Allclean script. By adding a test_*.py to each OpenFOAM test, py.test automatically discovers all tests in the folder and they can be run with:
py.test
with the command line option the test only run one time step
py.test --writeNSteps 1
Extensions
Running py.test with multple threads:
pip install pytest-xdist
the output can be pretified with the extension:
pip install pytest-sugar
Changelog
0.1.1 (2021-12-22)
added exit code to run_case, run_reset_case, clean_case accessible with: c_mod.meta_data[‘return_value’]
0.1.0 (2021-05-7)
added expected_results: loads a results in csv format and return the results in a pandas DataFrame:
test = oftest.expected_results([1,2],(‘isoAlpha’,32)) test[‘err_shape’]
0.0.5 (2021-05-7)
update documentation and added docstrings
0.0.4 (2021-04-24)
added fixture for running cleaning and modify
break compatiblity due to run_case does not clean the case anymore please substitute with run_reset_case
TL;DR
run_case -> run_reset_case
0.0.3 (2021-04-23)
changed License to GPL -> pyfoam is GPLv2
0.0.0 (2021-04-17)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for oftest-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f6d697737e5611b2d213db03fa03eef9ed74a337a6cc9e154deecf1bbe553f5 |
|
MD5 | 8bfc3eb120af51f8d02d8cce0a63b559 |
|
BLAKE2b-256 | 644306f8d7086a48f44800e0d7bea2fe840862679486374ef0a7661df0430751 |