aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/pytest/rewrite.py
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2023-08-24 13:46:13 +0300
committerthegeorg <thegeorg@yandex-team.com>2023-08-24 14:01:39 +0300
commita0e8ac430192b8b6acda11beccd9abe68ccd5fba (patch)
treea96631f8d231132eee007d075128b07fa43b9fb5 /library/python/pytest/rewrite.py
parentb3702478a961fe7ab5fc435582ff9fe75b8a0460 (diff)
downloadydb-a0e8ac430192b8b6acda11beccd9abe68ccd5fba.tar.gz
Fix some style issues in library/python/pytest
Two issues remain unfixed: ``` [fail] library/python/pytest/rewrite.py:96: [PLW0122] Use of exec (exec-used) [fail] library/python/pytest/yatest_tools.py:49: [F821] undefined name 'unicode' ```
Diffstat (limited to 'library/python/pytest/rewrite.py')
-rw-r--r--library/python/pytest/rewrite.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/library/python/pytest/rewrite.py b/library/python/pytest/rewrite.py
index 4cebcb1edd..38e80ebf5d 100644
--- a/library/python/pytest/rewrite.py
+++ b/library/python/pytest/rewrite.py
@@ -6,6 +6,7 @@ import ast
import py
from _pytest.assertion import rewrite
+
try:
import importlib.util
except ImportError:
@@ -66,10 +67,10 @@ class AssertionRewritingHook(rewrite.AssertionRewritingHook):
co = self._find_module(name, path)
if co is not None:
return importlib.util.spec_from_file_location(
- name,
- co.co_filename,
- loader=self,
- )
+ name,
+ co.co_filename,
+ loader=self,
+ )
def _should_rewrite(self, name, fn, state):
if name.startswith("__tests__.") or name.endswith(".conftest"):
@@ -84,6 +85,7 @@ class AssertionRewritingHook(rewrite.AssertionRewritingHook):
return importer.get_source(name)
if six.PY3:
+
def load_module(self, module):
co, _ = self.modules.pop(module.__name__)
try: