aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pytest/py3/_pytest/freeze_support.py
diff options
context:
space:
mode:
authormonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
committermonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
commit06e5c21a835c0e923506c4ff27929f34e00761c2 (patch)
tree75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /contrib/python/pytest/py3/_pytest/freeze_support.py
parent03f024c4412e3aa613bb543cf1660176320ba8f4 (diff)
downloadydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz
fix ya.make
Diffstat (limited to 'contrib/python/pytest/py3/_pytest/freeze_support.py')
-rw-r--r--contrib/python/pytest/py3/_pytest/freeze_support.py44
1 files changed, 0 insertions, 44 deletions
diff --git a/contrib/python/pytest/py3/_pytest/freeze_support.py b/contrib/python/pytest/py3/_pytest/freeze_support.py
deleted file mode 100644
index 9f8ea231fe..0000000000
--- a/contrib/python/pytest/py3/_pytest/freeze_support.py
+++ /dev/null
@@ -1,44 +0,0 @@
-"""Provides a function to report all internal modules for using freezing
-tools."""
-import types
-from typing import Iterator
-from typing import List
-from typing import Union
-
-
-def freeze_includes() -> List[str]:
- """Return a list of module names used by pytest that should be
- included by cx_freeze."""
- import _pytest
-
- result = list(_iter_all_modules(_pytest))
- return result
-
-
-def _iter_all_modules(
- package: Union[str, types.ModuleType],
- prefix: str = "",
-) -> Iterator[str]:
- """Iterate over the names of all modules that can be found in the given
- package, recursively.
-
- >>> import _pytest
- >>> list(_iter_all_modules(_pytest))
- ['_pytest._argcomplete', '_pytest._code.code', ...]
- """
- import os
- import pkgutil
-
- if isinstance(package, str):
- path = package
- else:
- # Type ignored because typeshed doesn't define ModuleType.__path__
- # (only defined on packages).
- package_path = package.__path__ # type: ignore[attr-defined]
- path, prefix = package_path[0], package.__name__ + "."
- for _, name, is_package in pkgutil.iter_modules([path]):
- if is_package:
- for m in _iter_all_modules(os.path.join(path, name), prefix=name + "."):
- yield prefix + m
- else:
- yield prefix + name