Do some refactoring

This commit is contained in:
Michael Mintz 2023-07-08 15:06:43 -04:00
parent 23a37aae5c
commit 11ed934ed5
2 changed files with 8 additions and 2 deletions

View File

@ -1972,7 +1972,10 @@ def pytest_terminal_summary(terminalreporter):
def _perform_pytest_unconfigure_():
from seleniumbase.core import proxy_helper
if not sb_config.multi_proxy:
if (
(hasattr(sb_config, "multi_proxy") and not sb_config.multi_proxy)
or not hasattr(sb_config, "multi_proxy")
):
proxy_helper.remove_proxy_zip_if_present()
if hasattr(sb_config, "reuse_session") and sb_config.reuse_session:
# Close the shared browser session

View File

@ -1225,7 +1225,10 @@ class SeleniumBrowser(Plugin):
def finalize(self, result):
"""This runs after all tests have completed with nosetests."""
if not sb_config.multi_proxy:
if (
(hasattr(sb_config, "multi_proxy") and not sb_config.multi_proxy)
or not hasattr(sb_config, "multi_proxy")
):
proxy_helper.remove_proxy_zip_if_present()
def afterTest(self, test):