diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2023-05-25 14:26:12 +0100 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2023-05-25 14:26:12 +0100 |
commit | 3e4fa1e2022970dee003bea0932ea0c10f8744ba (patch) | |
tree | d23b32b9a6e33dc57694547f1ec1427f1a19a01a /test/conftest.py | |
parent | 47cdfb6f30f7d56bffb806cc860e20806ea62f50 (diff) | |
download | unit-3e4fa1e2022970dee003bea0932ea0c10f8744ba.tar.gz unit-3e4fa1e2022970dee003bea0932ea0c10f8744ba.tar.bz2 |
Tests: removed unused variables.
Diffstat (limited to 'test/conftest.py')
-rw-r--r-- | test/conftest.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/conftest.py b/test/conftest.py index 926d83f8..4c548903 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -175,7 +175,7 @@ Unexpected prerequisite version "{prereq_version}" for module "{module}" in ) -def pytest_sessionstart(session): +def pytest_sessionstart(): option.available = {'modules': {}, 'features': {}} unit = unit_run() @@ -185,7 +185,7 @@ def pytest_sessionstart(session): # read unit.log - for i in range(50): + for _ in range(50): with open(Log.get_path(), 'r') as f: log = f.read() m = re.search('controller started', log) @@ -237,7 +237,7 @@ def pytest_sessionstart(session): @pytest.hookimpl(tryfirst=True, hookwrapper=True) -def pytest_runtest_makereport(item, call): +def pytest_runtest_makereport(item): # execute all other hooks to obtain the report object outcome = yield rep = outcome.get_result() @@ -567,7 +567,7 @@ def _clear_temp_dir(): if os.path.isfile(path) or stat.S_ISSOCK(os.stat(path).st_mode): os.remove(path) else: - for attempt in range(10): + for _ in range(10): try: shutil.rmtree(path) break @@ -582,7 +582,7 @@ def _check_processes(): controller_pid = _fds_info['controller']['pid'] unit_pid = unit_instance['pid'] - for i in range(600): + for _ in range(600): out = ( subprocess.check_output( ['ps', '-ax', '-o', 'pid', '-o', 'ppid', '-o', 'command'] @@ -625,7 +625,7 @@ def _check_processes(): @print_log_on_assert def _check_fds(*, log=None): def waitforfds(diff): - for i in range(600): + for _ in range(600): fds_diff = diff() if fds_diff <= option.fds_threshold: @@ -748,7 +748,7 @@ def skip_fds_check(): @pytest.fixture -def temp_dir(request): +def temp_dir(): return unit_instance['temp_dir'] @@ -758,16 +758,16 @@ def is_unsafe(request): @pytest.fixture -def is_su(request): +def is_su(): return os.geteuid() == 0 @pytest.fixture -def unit_pid(request): +def unit_pid(): return unit_instance['process'].pid -def pytest_sessionfinish(session): +def pytest_sessionfinish(): if not option.restart and option.save_log: print(f'Path to unit.log:\n{Log.get_path()}\n') |