Closed khaeru closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
99244af
) 75.3% compared to head (ccd5637
) 75.4%.
FYI @glatterf42, I was able to debug this issue with a temporary commit that made a change like this:
@pytest.fixture(scope="function")
def test_context(request, session_context):
"""A copy of :func:`session_context` scoped to one test function."""
from message_ix_models.model.config import Config
ctx = deepcopy(session_context)
# Defaults are preserved on session_context and thus ctx
assert session_context.model.regions == Config.regions
# Ensure there is a report key
ctx.setdefault("report", dict())
yield ctx
ctx.delete()
# Defaults are preserved on session_context and thus ctx
assert session_context.model.regions == Config.regions
This helped me see that the assertions failed after tests which used the mix_models_cli
fixture. This one was using the session_context
fixture, and so changes made to that Context by various CLI commands would be copied within test_context
and on to tests.
The last commit on this branch has the fix.
Currently, if either the commodity or technology lacks units, the exception is internal to pint and could be hard to interpret:
How to review
Read the diff and note that the CI checks all pass.
PR checklist