summaryrefslogtreecommitdiffstats
path: root/testing/auto_namedtuple.py
blob: d5a43775b6e74b2888932a1b7ad210fa39de8838 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
from __future__ import annotations

import collections


def auto_namedtuple(classname='auto_namedtuple', **kwargs):
    """Returns an automatic namedtuple object.

    Args:
        classname - The class name for the returned object.
        **kwargs - Properties to give the returned object.
    """
    return (collections.namedtuple(classname, kwargs.keys())(**kwargs))