Skip to content

Instantly share code, notes, and snippets.

View graingert-coef's full-sized avatar

graingert-coef

View GitHub Profile
"""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
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]
[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" ]
diff --git a/tests/test_udp.py b/tests/test_udp.py
index 71728ec..a4fa85f 100644
--- a/tests/test_udp.py
+++ b/tests/test_udp.py
@@ -265,6 +265,12 @@ class _TestUDP:
# it with EAGAIN), optionally letting the peer make room for it
# before the loop runs again, and return the protocol events.
# Any call to the loop's exception handler fails the test.
+ if self.implementation == 'asyncio' and sys.platform == 'darwin':
+ # macOS refuses UNIX datagrams with ENOBUFS rather than