py36+: remove _pytest.compat.fspath
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
import enum
|
||||
import functools
|
||||
import inspect
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from contextlib import contextmanager
|
||||
@@ -55,18 +54,6 @@ def _format_args(func: Callable[..., Any]) -> str:
|
||||
REGEX_TYPE = type(re.compile(""))
|
||||
|
||||
|
||||
if sys.version_info < (3, 6):
|
||||
|
||||
def fspath(p):
|
||||
"""os.fspath replacement, useful to point out when we should replace it by the
|
||||
real function once we drop py35."""
|
||||
return str(p)
|
||||
|
||||
|
||||
else:
|
||||
fspath = os.fspath
|
||||
|
||||
|
||||
def is_generator(func: object) -> bool:
|
||||
genfunc = inspect.isgeneratorfunction(func)
|
||||
return genfunc and not iscoroutinefunction(func)
|
||||
|
||||
Reference in New Issue
Block a user