diff --git a/pyproject.toml b/pyproject.toml index c173e66f6..2b43241d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -274,8 +274,6 @@ ignore = [ "SIM115", # use context handler for opening files "SIM117", # use single 'with' statement "SIM118", # use key in dict not key in dict.keys() - # flake8-slots - "SLOT002", # Subclasses of collections.namedtuple() should define __slots__ # flake8-self "SLF001", # private member accessed # flake8-print diff --git a/tests/test_search.py b/tests/test_search.py index 3a20d5d90..68a7b01aa 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -2,7 +2,6 @@ import json import warnings -from collections import namedtuple from io import BytesIO import pytest @@ -12,12 +11,19 @@ from docutils.parsers import rst from sphinx.search import IndexBuilder -class DummyEnvironment(namedtuple('DummyEnvironment', ['version', 'domains'])): +class DummyEnvironment: + def __init__(self, version, domains): + self.version = version + self.domains = domains + def __getattr__(self, name): if name.startswith('_search_index_'): setattr(self, name, {}) return getattr(self, name, {}) + def __str__(self): + return f'DummyEnvironment({self.version!r}, {self.domains!r})' + class DummyDomain: def __init__(self, data):