diff --git a/falcon/util/misc.py b/falcon/util/misc.py index 666019a41..bac598ebc 100644 --- a/falcon/util/misc.py +++ b/falcon/util/misc.py @@ -28,7 +28,6 @@ import http import inspect import re -from typing import Callable import unicodedata from falcon import status_codes @@ -71,17 +70,17 @@ _UNSAFE_CHARS = re.compile(r'[^a-zA-Z0-9.-]') # PERF(kgriffs): Avoid superfluous namespace lookups -_strptime: Callable[[str, str], datetime.datetime] = datetime.datetime.strptime -_utcnow: Callable[[], datetime.datetime] = functools.partial( +_strptime = datetime.datetime.strptime +_utcnow = functools.partial( datetime.datetime.now, datetime.timezone.utc ) # The above aliases were not underscored prior to Falcon 3.1.2. -strptime: Callable[[str, str], datetime.datetime] = deprecated( +strptime = deprecated( 'This was a private alias local to this module; ' 'please reference datetime.strptime() directly.' )(datetime.datetime.strptime) -utcnow: Callable[[], datetime.datetime] = deprecated( +utcnow = deprecated( 'This was a private alias local to this module; ' 'please reference datetime.utcnow() directly.' )(datetime.datetime.utcnow) diff --git a/tox.ini b/tox.ini index df064befd..fe2831bf1 100644 --- a/tox.ini +++ b/tox.ini @@ -99,6 +99,13 @@ deps = {[testenv]deps} commands = pip uninstall --yes msgpack coverage run -m pytest tests -k "test_ws and test_msgpack_missing" +[testenv:py35] +deps = {[testenv]deps} + pytest-randomly + jsonschema +commands = python "{toxinidir}/tools/clean.py" "{toxinidir}/falcon" + coverage run -m pytest tests --ignore=tests/asgi [] + [testenv:py310] basepython = python3.10 deps = {[testenv]deps}