aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-05-10 18:28:06 -0700
committerGravatar MarkKoz <[email protected]>2020-05-11 12:03:12 -0700
commitd8d8e144adfe4c2de15dbbf4346e2eec548a9f67 (patch)
treeca6e2556228d0de162c1d50e9641aa3d71102ee8 /tests/helpers.py
parentTest token regex matches valid tokens (diff)
Correct the return type annotation for the autospec decorator
Diffstat (limited to 'tests/helpers.py')
-rw-r--r--tests/helpers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/helpers.py b/tests/helpers.py
index dfbe539ec..3cd8a63c0 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -4,7 +4,7 @@ import collections
import itertools
import logging
import unittest.mock
-from typing import Iterable, Optional
+from typing import Callable, Iterable, Optional
import discord
from discord.ext.commands import Context
@@ -23,7 +23,7 @@ for logger in logging.Logger.manager.loggerDict.values():
logger.setLevel(logging.CRITICAL)
-def autospec(target, *attributes: str, **kwargs) -> unittest.mock._patch:
+def autospec(target, *attributes: str, **kwargs) -> Callable:
"""Patch multiple `attributes` of a `target` with autospecced mocks and `spec_set` as True."""
# Caller's kwargs should take priority and overwrite the defaults.
kwargs = {'spec_set': True, 'autospec': True, **kwargs}