Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/Support/bskReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Version |release|
- Fixed range of grammatical typos in the Basilisk documentation
- Ensure the HTML documentation figures from the example scenario look more consistent
- Avoid a memory leak when saving off figures in the CI Unit tests to build the online documentation
- Deprecated the ``pytest`` optional flag ``show_plots``.


Version 2.9.0 (Jan. 28 2026)
Expand Down
28 changes: 28 additions & 0 deletions src/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import subprocess
import sys
import warnings
from datetime import date

import matplotlib as mpl
import matplotlib.pyplot as plt
Expand All @@ -33,6 +34,14 @@
category=DeprecationWarning,
)

SHOW_PLOTS_REMOVAL_DATE = date(2027, 2, 12)
SHOW_PLOTS_DEPRECATION_MESSAGE = (
"The pytest option '--show_plots' is deprecated and will be removed after February 12, 2027."
)
SHOW_PLOTS_ELEVATED_MESSAGE = (
"The pytest option '--show_plots' has been deprecated for a year and will be removed shortly."
)

filename = inspect.getframeinfo(inspect.currentframe()).filename
path = os.path.dirname(os.path.abspath(filename))
print(path)
Expand All @@ -50,6 +59,25 @@ def pytest_addoption(parser):
help="whether or not to gen a pytest-html report. The report is saved in ./tests/report")


def _show_plots_warning_details(today=None):
if today is None:
today = date.today()

if today > SHOW_PLOTS_REMOVAL_DATE:
return SHOW_PLOTS_ELEVATED_MESSAGE, "red"
return SHOW_PLOTS_DEPRECATION_MESSAGE, "yellow"


def pytest_terminal_summary(terminalreporter, exitstatus, config):
if not config.getoption("--show_plots"):
return

warning_message, terminal_color = _show_plots_warning_details()
message = f"DEPRECATION WARNING: {warning_message}"
terminalreporter.write_sep("=", "SHOW_PLOTS DEPRECATION", **{terminal_color: True}, bold=True)
terminalreporter.write_line(message, **{terminal_color: True}, bold=True)


@pytest.fixture(scope="module")
def show_plots(request):
return request.config.getoption("--show_plots")
Expand Down
34 changes: 34 additions & 0 deletions src/tests/test_show_plots_cutoff_notice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# ISC License
#
# Copyright (c) 2026, Autonomous Vehicle Systems Lab, University of Colorado at Boulder
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

from datetime import date
import warnings

import conftest


def test_show_plots_cutoff_notice():
"""Emit a visible reminder after the cutoff date without failing tests."""
if date.today() <= conftest.SHOW_PLOTS_REMOVAL_DATE:
return

warnings.warn(
"The cutoff date for '--show_plots' has passed. Please remove the deprecated show_plots pytest option/fixture usage.",
UserWarning,
stacklevel=1,
)