py36+: remove _pytest.compat.fspath

This commit is contained in:
Anthony Sottile
2020-10-02 12:20:51 -07:00
parent a23666d554
commit be43c7c67b
2 changed files with 7 additions and 21 deletions
-13
View File
@@ -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)