Commit a0a0bf0b authored by René Fritze's avatar René Fritze
Browse files

[tests] ensure we get no dune import warnings in our CI

parent 26f252fa
......@@ -2,6 +2,8 @@
# Copyright pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
import os
import warnings
import pytest
from pymor.core.config import config, _PACKAGES
......@@ -12,3 +14,27 @@ from pymor.core.config import config, _PACKAGES
reason='Guarantee only valid in the docker container')
def test_config(pkg):
assert getattr(config, f'HAVE_{pkg}')
@pytest.mark.skipif(condition=not os.environ.get('DOCKER_PYMOR', False),
reason='Guarantee only valid in the docker container')
def test_no_dune_warnings():
_test_dune_import_warn()
@pytest.mark.skipif(condition=not os.environ.get('DOCKER_PYMOR', False),
reason='Guarantee only valid in the docker container')
def test_dune_warnings(monkeypatch):
from dune import xt, gdt
monkeypatch.setattr(gdt, "__version__", "2020.0.0")
monkeypatch.setattr(xt, "__version__", "2020.0.0")
with pytest.xfail(""):
_test_dune_import_warn()
def _test_dune_import_warn():
with warnings.catch_warnings():
from pymor.core.config import _get_dunegdt_version
# this will result in an error if a warning is caught
warnings.simplefilter("error")
_get_dunegdt_version()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment