Skip to content

Commit da9e66c

Browse files
committed
Fix flake8 report
Signed-off-by: Nig3l <[email protected]>
1 parent f8a8f49 commit da9e66c

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

src/rez/plugin_managers.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,11 @@ def register_plugin_module(self, plugin_name, plugin_module, plugin_path):
210210

211211
plugin_class = plugin_module.register_plugin()
212212
if plugin_class is not None:
213-
self.register_plugin(plugin_name,
214-
plugin_class,
215-
plugin_module)
213+
self.register_plugin(
214+
plugin_name,
215+
plugin_class,
216+
plugin_module
217+
)
216218
else:
217219
if config.debug("plugins"):
218220
print_warning(

src/rez/tests/test_plugin_manager.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def setUp(self):
5050
TestBase.setUp(self)
5151
self._reset_plugin_manager()
5252

53-
def _test_load_plugin_from_plugin_path(self):
53+
def test_load_plugin_from_plugin_path(self):
5454
"""Test loading rez plugin from plugin_path"""
5555
self.update_settings(dict(
5656
plugin_path=[self.data_path("extensions", "foo")]
@@ -60,7 +60,7 @@ def _test_load_plugin_from_plugin_path(self):
6060
"package_repository", "cloud")
6161
self.assertEqual(cloud_cls.name(), "cloud")
6262

63-
def _test_load_plugin_from_python_module(self):
63+
def test_load_plugin_from_python_module(self):
6464
"""Test loading rez plugin from python modules"""
6565
with restore_sys_path():
6666
sys.path.append(self.data_path("extensions"))
@@ -76,7 +76,7 @@ def test_load_plugin_from_entry_points(self):
7676
"command", "baz")
7777
self.assertEqual(baz_cls.name(), "baz")
7878

79-
def _test_plugin_override_1(self):
79+
def test_plugin_override_1(self):
8080
"""Test plugin from plugin_path can override the default"""
8181
self.update_settings(dict(
8282
plugin_path=[self.data_path("extensions", "non-mod")]
@@ -86,7 +86,7 @@ def _test_plugin_override_1(self):
8686
"package_repository", "memory")
8787
self.assertEqual("non-mod", mem_cls.on_test)
8888

89-
def _test_plugin_override_2(self):
89+
def test_plugin_override_2(self):
9090
"""Test plugin from python modules can override the default"""
9191
with restore_sys_path():
9292
sys.path.append(self.data_path("extensions"))
@@ -95,7 +95,7 @@ def _test_plugin_override_2(self):
9595
"package_repository", "memory")
9696
self.assertEqual("bar", mem_cls.on_test)
9797

98-
def _test_plugin_override_3(self):
98+
def test_plugin_override_3(self):
9999
"""Test plugin from python modules can override plugin_path"""
100100
with restore_sys_path():
101101
# setup new

src/rez/tests/util.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ def wrapper(self, *args, **kwargs):
301301
return decorator
302302

303303

304-
305304
_restore_sys_path_lock = threading.Lock()
306305
_restore_os_environ_lock = threading.Lock()
307306
_restore_pip_lock = threading.Lock()
@@ -365,13 +364,14 @@ def restore_os_environ():
365364
os.environ.clear()
366365
os.environ.update(original)
367366

367+
368368
@contextmanager
369369
def restore_pip(package_name, package_path):
370370
from pip._internal import main as pipmain
371-
371+
372372
with _restore_pip_lock:
373373
pipmain(['install', package_path])
374-
374+
375375
yield True
376376

377-
pipmain(['uninstall', package_name, "-y"])
377+
pipmain(['uninstall', package_name, "-y"])

0 commit comments

Comments
 (0)