Files
geMoldInsight/venv/lib/python3.11/site-packages/pyvista/conftest.py
T
2026-02-12 23:27:48 +08:00

25 lines
561 B
Python

"""Close all plotters to help control memory usage for our doctests."""
from __future__ import annotations
import pytest
import pyvista
@pytest.fixture(autouse=True)
def autoclose_plotters():
"""Close all plotters."""
yield
pyvista.close_all()
@pytest.fixture(autouse=True)
def reset_global_theme():
"""Reset global_theme."""
# this stops any doctest-module tests from overriding the global theme and
# creating test side effects
pyvista.set_plot_theme('document_build')
yield
pyvista.set_plot_theme('document_build')