Use a frozen attr class for PseudoFixtureDef.

This commit is contained in:
Allan Feldman 2018-02-21 22:59:33 -08:00
parent 7536e949b1
commit 48548767fc
1 changed files with 6 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import functools
import inspect import inspect
import sys import sys
import warnings import warnings
from collections import OrderedDict, deque, defaultdict, namedtuple from collections import OrderedDict, deque, defaultdict
import attr import attr
import py import py
@ -23,7 +23,11 @@ from _pytest.compat import (
) )
from _pytest.outcomes import fail, TEST_OUTCOME 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): def pytest_sessionstart(session):