summaryrefslogtreecommitdiff
path: root/tests/helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/helpers.py')
-rw-r--r--tests/helpers.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/tests/helpers.py b/tests/helpers.py
index 1645138c..0503097e 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -15,12 +15,10 @@ import subprocess
import textwrap
import warnings
-from types import ModuleType
from typing import (
cast,
Any, Callable, Generator, Iterable, List, Optional, Set, Tuple, Type, Union,
)
-from unittest import mock
import pytest
@@ -284,24 +282,6 @@ def change_dir(new_dir: str) -> Generator[None, None, None]:
os.chdir(old_dir)
-def without_module(using_module: ModuleType, missing_module_name: str) -> mock._patch[Any]:
- """
- Hide a module for testing.
-
- Use this in a test function to make an optional module unavailable during
- the test::
-
- with without_module(product.something, 'tomli'):
- use_toml_somehow()
-
- Arguments:
- using_module: a module in which to hide `missing_module_name`.
- missing_module_name (str): the name of the module to hide.
-
- """
- return mock.patch.object(using_module, missing_module_name, None)
-
-
def assert_count_equal(a: Iterable[Union[int, str]], b: Iterable[Union[int, str]]) -> None:
"""
A pytest-friendly implementation of assertCountEqual.