Merge pull request #4775 from asottile/stdlib

Replace flatten() with chain.from_iterable
This commit is contained in:
Anthony Sottile 2019-02-12 21:37:05 -05:00 committed by GitHub
commit f0e6bf7604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -4,6 +4,7 @@ from __future__ import print_function
import functools import functools
import inspect import inspect
import itertools
import sys import sys
import warnings import warnings
from collections import defaultdict from collections import defaultdict
@ -13,7 +14,6 @@ from collections import OrderedDict
import attr import attr
import py import py
import six import six
from more_itertools import flatten
import _pytest import _pytest
from _pytest import nodes from _pytest import nodes
@ -1109,7 +1109,7 @@ class FixtureManager(object):
argnames = getfuncargnames(func, cls=cls) argnames = getfuncargnames(func, cls=cls)
else: else:
argnames = () argnames = ()
usefixtures = flatten( usefixtures = itertools.chain.from_iterable(
mark.args for mark in node.iter_markers(name="usefixtures") mark.args for mark in node.iter_markers(name="usefixtures")
) )
initialnames = tuple(usefixtures) + argnames initialnames = tuple(usefixtures) + argnames