diff options
author | 2023-04-09 00:34:55 +0300 | |
---|---|---|
committer | 2023-04-09 00:34:55 +0300 | |
commit | c74a3c645d23d22206182813478f6c9b74812ed8 (patch) | |
tree | 62b648f92c2607a5ed94f90a86b09698d16f8c98 /tests/_autospec.py | |
parent | Fix: use nomination.user_id instead of id in get_or_fetch_member (diff) | |
parent | Merge pull request #2517 from python-discord/thread_filter (diff) |
Merge branch 'main' into 2302-activity-in-reviews
Diffstat (limited to 'tests/_autospec.py')
-rw-r--r-- | tests/_autospec.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/_autospec.py b/tests/_autospec.py index ee2fc1973..ecff6bcbe 100644 --- a/tests/_autospec.py +++ b/tests/_autospec.py @@ -1,5 +1,6 @@ import contextlib import functools +import pkgutil import unittest.mock from typing import Callable @@ -51,7 +52,7 @@ def autospec(target, *attributes: str, pass_mocks: bool = True, **patch_kwargs) # Import the target if it's a string. # This is to support both object and string targets like patch.multiple. if type(target) is str: - target = unittest.mock._importer(target) + target = pkgutil.resolve_name(target) def decorator(func): for attribute in attributes: |