aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pytest/py2/_pytest/freeze_support.py
diff options
context:
space:
mode:
authordeshevoy <deshevoy@yandex-team.ru>2022-02-10 16:46:57 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:57 +0300
commit28148f76dbfcc644d96427d41c92f36cbf2fdc6e (patch)
treeb83306b6e37edeea782e9eed673d89286c4fef35 /contrib/python/pytest/py2/_pytest/freeze_support.py
parente988f30484abe5fdeedcc7a5d3c226c01a21800c (diff)
downloadydb-28148f76dbfcc644d96427d41c92f36cbf2fdc6e.tar.gz
Restoring authorship annotation for <deshevoy@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/pytest/py2/_pytest/freeze_support.py')
-rw-r--r--contrib/python/pytest/py2/_pytest/freeze_support.py94
1 files changed, 47 insertions, 47 deletions
diff --git a/contrib/python/pytest/py2/_pytest/freeze_support.py b/contrib/python/pytest/py2/_pytest/freeze_support.py
index 1743e38bf6..aeeec2a56b 100644
--- a/contrib/python/pytest/py2/_pytest/freeze_support.py
+++ b/contrib/python/pytest/py2/_pytest/freeze_support.py
@@ -1,48 +1,48 @@
# -*- coding: utf-8 -*-
-"""
-Provides a function to report all internal modules for using freezing tools
-pytest
-"""
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-
-
-def freeze_includes():
- """
- Returns a list of module names used by pytest that should be
- included by cx_freeze.
- """
- import py
- import _pytest
-
- result = list(_iter_all_modules(py))
- result += list(_iter_all_modules(_pytest))
- return result
-
-
-def _iter_all_modules(package, prefix=""):
- """
- Iterates over the names of all modules that can be found in the given
- package, recursively.
- Example:
- _iter_all_modules(_pytest) ->
- ['_pytest.assertion.newinterpret',
- '_pytest.capture',
- '_pytest.core',
- ...
- ]
- """
- import os
- import pkgutil
-
- if type(package) is not str:
- path, prefix = package.__path__[0], package.__name__ + "."
- else:
- path = package
- 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
+"""
+Provides a function to report all internal modules for using freezing tools
+pytest
+"""
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+
+
+def freeze_includes():
+ """
+ Returns a list of module names used by pytest that should be
+ included by cx_freeze.
+ """
+ import py
+ import _pytest
+
+ result = list(_iter_all_modules(py))
+ result += list(_iter_all_modules(_pytest))
+ return result
+
+
+def _iter_all_modules(package, prefix=""):
+ """
+ Iterates over the names of all modules that can be found in the given
+ package, recursively.
+ Example:
+ _iter_all_modules(_pytest) ->
+ ['_pytest.assertion.newinterpret',
+ '_pytest.capture',
+ '_pytest.core',
+ ...
+ ]
+ """
+ import os
+ import pkgutil
+
+ if type(package) is not str:
+ path, prefix = package.__path__[0], package.__name__ + "."
+ else:
+ path = package
+ 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