From 48548767fcc1c65134309b649cf4d63f5b9cec65 Mon Sep 17 00:00:00 2001 From: Allan Feldman Date: Wed, 21 Feb 2018 22:59:33 -0800 Subject: [PATCH] Use a frozen attr class for PseudoFixtureDef. --- _pytest/fixtures.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/_pytest/fixtures.py b/_pytest/fixtures.py index 21fc32846..f9d0ef572 100644 --- a/_pytest/fixtures.py +++ b/_pytest/fixtures.py @@ -4,7 +4,7 @@ import functools import inspect import sys import warnings -from collections import OrderedDict, deque, defaultdict, namedtuple +from collections import OrderedDict, deque, defaultdict import attr import py @@ -23,7 +23,11 @@ from _pytest.compat import ( ) from _pytest.outcomes import fail, TEST_OUTCOME -PseudoFixtureDef = namedtuple('PseudoFixtureDef', ('cached_result', 'scope')) + +@attr.s(frozen=True) +class PseudoFixtureDef(object): + cached_result = attr.ib() + scope = attr.ib() def pytest_sessionstart(session):