Coverage for tests/conftest.py: 100%
11 statements
« prev ^ index » next coverage.py v7.17.0, created at 2026-11-14 09:29 +0000
« prev ^ index » next coverage.py v7.17.0, created at 2026-11-14 09:29 +0000
1"""Shared fixtures for the tests."""
3from __future__ import annotations
5import copy
6from collections.abc import Iterator
8import pytest
10import chrisjen
13@pytest.fixture(autouse = True)
14def restore_library() -> Iterator[None]:
15 """Removes the classes that a test adds to the library."""
16 saved = copy.deepcopy(chrisjen.library.contents)
17 yield
18 chrisjen.library.contents.clear()
19 chrisjen.library.contents.update(saved)