Source code for message_ix_models.tests.test_testing

import os

from message_ix_models.testing import bare_res, not_ci


[docs]def test_bare_res_no_request(test_context): """:func:`.bare_res` works with `request` = :obj:`None`.""" bare_res(None, test_context, solved=False)
[docs]def test_bare_res_solved(request, test_context): """:func:`.bare_res` works with `solve` = :obj:`True`. This test can be removed once this feature of the test function is used by another test. """ bare_res(request, test_context, solved=True)
[docs]def test_cli_runner(mix_models_cli): result = mix_models_cli.invoke(["foo", "bar"]) assert "No such command 'foo'" in result.output
[docs]@not_ci(reason="foo", action="skip") def test_not_ci_skip(): """Test not_ci(action="skip")."""
[docs]@not_ci(reason="foo", action="xfail") def test_not_ci_xfail(): """Test not_ci(action="skip").""" assert "GITHUB_ACTIONS" not in os.environ