Skip to content

Commit

Permalink
Add a test case with snek5000-cbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinvis committed Nov 12, 2021
1 parent 70c9845 commit 02da309
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ pip install -e '.[dev]'
pip install --no-deps -r ./docs/test-requirements.txt
```


## General guidelines

* **Editor**: Use an editor which supports [EditorConfig](http://editorconfig.org/)
Expand Down
20 changes: 20 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,26 @@ def sim_executed():
return sim


@pytest.fixture(scope="module")
def sim_cbox_executed():
from snek5000_cbox.solver import Simul

params = Simul.create_default_params()
params.output.sub_directory = "test"

params.nek.general.stop_at = "endTime"
params.nek.general.end_time = 10 * abs(params.nek.general.dt)
params.nek.general.write_interval = 5

params.oper.nproc_min = 2
params.oper.nproc_max = 12
params.oper.nx = params.oper.ny = params.oper.nz = 3

sim = Simul(params)
sim.make.exec(["run_fg"])
return sim


@pytest.fixture(scope="function")
def sim_data(tmpdir_factory):
"""Generate fake simulation data."""
Expand Down
8 changes: 4 additions & 4 deletions tests/test_restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ def test_phys_fields_uninit(sim):


@pytest.mark.slow
@pytest.mark.xfail(ValueError, reason=pymech_issue)
def test_phys_fields_get_var_before_load(sim_executed):
sim_executed.output.phys_fields.init_reader()
ux = sim_executed.output.phys_fields.get_var("ux")
def test_phys_fields_get_var_before_load(sim_cbox_executed):
sim = sim_cbox_executed
sim.output.phys_fields.init_reader()
ux = sim.output.phys_fields.get_var("ux")
assert isinstance(ux, xr.DataArray)


Expand Down

0 comments on commit 02da309

Please sign in to comment.