Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load pytest_config.py via config files #287

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions model/atmosphere/advection/advection_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,8 @@
# distribution for a copy of the license or check <https://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-3.0-or-later
import pytest
from gt4py.next.program_processors.runners.roundtrip import executor

from icon4py.model.common.test_utils.simple_mesh import SimpleMesh


BACKENDS = {"embedded": executor}
MESHES = {"simple_mesh": SimpleMesh()}


@pytest.fixture(
ids=MESHES.keys(),
params=MESHES.values(),
from icon4py.model.common.test_utils.fixtures import ( # noqa : F401 # fixtures from test_utils
backend,
mesh,
)
def mesh(request):
return request.param


@pytest.fixture(ids=BACKENDS.keys(), params=BACKENDS.values())
def backend(request):
return request.param
1 change: 1 addition & 0 deletions model/atmosphere/advection/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ warn_unused_ignores = true
[tool.pytest]

[tool.pytest.ini_options]
addopts = ['-p icon4py.model.common.test_utils.pytest_config']
markers = 'slow_tests: marks tests as slow'
testpaths = ['tests', 'advection_tests']

Expand Down
6 changes: 0 additions & 6 deletions model/atmosphere/diffusion/diffusion_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
step_date_exit,
step_date_init,
)
from icon4py.model.common.test_utils.pytest_config import ( # noqa: F401
pytest_addoption,
pytest_configure,
pytest_generate_tests,
pytest_runtest_setup,
)


@pytest.fixture
Expand Down
1 change: 1 addition & 0 deletions model/atmosphere/diffusion/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ warn_unused_ignores = true
[tool.pytest]

[tool.pytest.ini_options]
addopts = ['-p icon4py.model.common.test_utils.pytest_config']
markers = [
"datatest: test depending on serialized data generated by a full model run"
]
Expand Down
1 change: 1 addition & 0 deletions model/atmosphere/dycore/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ warn_unused_ignores = true
[tool.pytest]

[tool.pytest.ini_options]
addopts = ['-p icon4py.model.common.test_utils.pytest_config']
testpaths = 'tests'

[tool.setuptools.dynamic]
Expand Down
6 changes: 0 additions & 6 deletions model/atmosphere/dycore/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@
step_date_exit,
step_date_init,
)
from icon4py.model.common.test_utils.pytest_config import ( # noqa: F401
pytest_addoption,
pytest_configure,
pytest_generate_tests,
pytest_runtest_setup,
)
1 change: 1 addition & 0 deletions model/common/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ warn_unused_ignores = true
[tool.pytest]

[tool.pytest.ini_options]
addopts = ['-p icon4py.model.common.test_utils.pytest_config']
markers = [
"datatest: test depending on serialized data generated by a full model run",
"with_netcdf: test depending on a compatible version of netCDF4"
Expand Down
6 changes: 0 additions & 6 deletions model/common/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
processor_props,
ranked_data_path,
)
from icon4py.model.common.test_utils.pytest_config import ( # noqa: F401
pytest_addoption,
pytest_configure,
pytest_generate_tests,
pytest_runtest_setup,
)


grids_path = base_path.joinpath("grids")
Expand Down
1 change: 1 addition & 0 deletions model/driver/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ warn_unused_ignores = true
[tool.pytest]

[tool.pytest.ini_options]
addopts = ['-p icon4py.model.common.test_utils.pytest_config']
testpaths = 'tests'

[tool.setuptools.dynamic]
Expand Down
5 changes: 0 additions & 5 deletions model/driver/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,3 @@
processor_props,
ranked_data_path,
)
from icon4py.model.common.test_utils.pytest_config import ( # noqa: F401
pytest_addoption,
pytest_configure,
pytest_runtest_setup,
)
2 changes: 2 additions & 0 deletions model/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ skip_install = true
commands =
commands_post =

[pytest]
addopts = -p icon4py.model.common.test_utils.pytest_config
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ markers =
slow_tests: mark test as slow.
datatest: test depending on serialized data generated by a full model run
with_netcdf: test depending on a compatible version of netCDF4
addopts = -p icon4py.model.common.test_utils.pytest_config