Skip to content

Instantly share code, notes, and snippets.

View graingert-coef's full-sized avatar

graingert-coef

View GitHub Profile
[tool.pytest.ini_options]
addopts = [
"--strict-config",
"--strict-markers",
"--cov",
"--cov-report=term-missing:skip-covered",
"--cov-config=pyproject.toml",
]
xfail_strict = true
filterwarnings = [ "error" ]
import argparse
import git
import requirements
def get_version(req):
"""Extracts version from requirement or raises an error if not specified."""
if req.specs:
return req.specs[0][1]
else:
raise ValueError(f"Package {req.name} does not specify a version with '=='.")
"""Middleware."""
from __future__ import annotations
import logging
import pathlib
from django.conf import settings
from whitenoise.middleware import WhiteNoiseMiddleware # type: ignore[import-untyped]
"""Wrapper for matplotlib's image comparison test decorator."""
import contextlib
import locale as locale_module
from collections.abc import Callable, Generator, Iterable
from locale import _setlocale as private_setlocale # type: ignore[attr-defined]
from typing import overload
from unittest import mock
import matplotlib as mpl