diff --git a/requirements.txt b/requirements.txt index f144a905b20..c621f0736e3 100755 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ pip>=25.0.1;python_version<"3.9" pip>=25.1.1;python_version>="3.9" packaging>=25.0 setuptools~=70.2;python_version<"3.10" -setuptools>=80.8.0;python_version>="3.10" +setuptools>=80.9.0;python_version>="3.10" wheel>=0.45.1 attrs>=25.3.0 certifi>=2025.4.26 @@ -35,7 +35,7 @@ chardet==5.2.0 charset-normalizer>=3.4.2,<4 urllib3>=1.26.20,<2;python_version<"3.10" urllib3>=1.26.20,<2.5.0;python_version>="3.10" -requests==2.32.3 +requests==2.32.4 sniffio==1.3.1 h11==0.16.0 outcome==1.3.0.post0 @@ -54,7 +54,8 @@ execnet==2.1.1 iniconfig==2.1.0 pluggy==1.5.0;python_version<"3.9" pluggy==1.6.0;python_version>="3.9" -pytest==8.3.5 +pytest==8.3.5;python_version<"3.9" +pytest==8.4.0;python_version>="3.9" pytest-html==4.0.2 pytest-metadata==3.1.1 pytest-ordering==0.6 diff --git a/seleniumbase/__version__.py b/seleniumbase/__version__.py index 67183a28a98..9316bd83daa 100755 --- a/seleniumbase/__version__.py +++ b/seleniumbase/__version__.py @@ -1,2 +1,2 @@ # seleniumbase package -__version__ = "4.39.2" +__version__ = "4.39.3" diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py index 7d2f28de125..9e209cb6522 100644 --- a/seleniumbase/fixtures/base_case.py +++ b/seleniumbase/fixtures/base_case.py @@ -4592,9 +4592,9 @@ def load_cookies(self, name="cookies.txt", expiry=False): Loads the page cookies from the "saved_cookies" folder. Usage for setting expiry: If expiry == 0 or False: Delete "expiry". + If expiry is True: Set "expiry" to 24 hours in the future. If expiry == -1 (or < 0): Do not modify "expiry". If expiry > 0: Set "expiry" to expiry minutes in the future. - If expiry == True: Set "expiry" to 24 hours in the future. """ cookies = self.get_saved_cookies(name) self.wait_for_ready_state_complete() @@ -4606,12 +4606,12 @@ def load_cookies(self, name="cookies.txt", expiry=False): cookie["domain"] = trim_origin if "expiry" in cookie and (not expiry or expiry == 0): del cookie["expiry"] + elif expiry is True: + cookie["expiry"] = int(time.time()) + 86400 elif isinstance(expiry, (int, float)) and expiry < 0: pass elif isinstance(expiry, (int, float)) and expiry > 0: cookie["expiry"] = int(time.time()) + int(expiry * 60.0) - elif expiry: - cookie["expiry"] = int(time.time()) + 86400 self.driver.add_cookie(cookie) def delete_all_cookies(self): @@ -4693,9 +4693,9 @@ def add_cookie(self, cookie_dict, expiry=False): self.add_cookie({'name': 'foo', 'value': 'bar', 'sameSite': 'Strict'}) Usage for setting expiry: If expiry == 0 or False: Delete "expiry". + If expiry is True: Set "expiry" to 24 hours in the future. If expiry == -1 (or < 0): Do not modify "expiry". If expiry > 0: Set "expiry" to expiry minutes in the future. - If expiry == True: Set "expiry" to 24 hours in the future. """ self.__check_scope() self._check_browser() @@ -4707,21 +4707,21 @@ def add_cookie(self, cookie_dict, expiry=False): cookie["domain"] = trim_origin if "expiry" in cookie and (not expiry or expiry == 0): del cookie["expiry"] + elif expiry is True: + cookie["expiry"] = int(time.time()) + 86400 elif isinstance(expiry, (int, float)) and expiry < 0: pass elif isinstance(expiry, (int, float)) and expiry > 0: cookie["expiry"] = int(time.time()) + int(expiry * 60.0) - elif expiry: - cookie["expiry"] = int(time.time()) + 86400 self.driver.add_cookie(cookie_dict) def add_cookies(self, cookies, expiry=False): """ Usage for setting expiry: If expiry == 0 or False: Delete "expiry". + If expiry is True: Set "expiry" to 24 hours in the future. If expiry == -1 (or < 0): Do not modify "expiry". If expiry > 0: Set "expiry" to expiry minutes in the future. - If expiry == True: Set "expiry" to 24 hours in the future. """ self.__check_scope() self._check_browser() @@ -4733,12 +4733,12 @@ def add_cookies(self, cookies, expiry=False): cookie["domain"] = trim_origin if "expiry" in cookie and (not expiry or expiry == 0): del cookie["expiry"] + elif expiry is True: + cookie["expiry"] = int(time.time()) + 86400 elif isinstance(expiry, (int, float)) and expiry < 0: pass elif isinstance(expiry, (int, float)) and expiry > 0: cookie["expiry"] = int(time.time()) + int(expiry * 60.0) - elif expiry: - cookie["expiry"] = int(time.time()) + 86400 self.driver.add_cookie(cookie) def __set_esc_skip(self): diff --git a/seleniumbase/plugins/pytest_plugin.py b/seleniumbase/plugins/pytest_plugin.py index a9b4897793c..130de345af9 100644 --- a/seleniumbase/plugins/pytest_plugin.py +++ b/seleniumbase/plugins/pytest_plugin.py @@ -2160,7 +2160,12 @@ def _perform_pytest_unconfigure_(config): from seleniumbase.core import proxy_helper reporter = config.pluginmanager.get_plugin("terminalreporter") - duration = time.time() - reporter._sessionstarttime + start_time = None + if hasattr(reporter, "_sessionstarttime"): + start_time = reporter._sessionstarttime # (pytest < 8.4.0) + else: + start_time = reporter._session_start.time # (pytest >= 8.4.0) + duration = time.time() - start_time if ( (hasattr(sb_config, "multi_proxy") and not sb_config.multi_proxy) or not hasattr(sb_config, "multi_proxy") @@ -2497,7 +2502,11 @@ def pytest_unconfigure(config): if "--co" in sys_argv or "--collect-only" in sys_argv: return reporter = config.pluginmanager.get_plugin("terminalreporter") - if not hasattr(reporter, "_sessionstarttime"): + if ( + not hasattr(reporter, "_sessionstarttime") + and not hasattr(reporter, "_session_start") + and not hasattr(reporter._session_start, "time") + ): return if hasattr(sb_config, "_multithreaded") and sb_config._multithreaded: import fasteners diff --git a/setup.py b/setup.py index 899bdbaded7..4609f8385f3 100755 --- a/setup.py +++ b/setup.py @@ -56,10 +56,6 @@ os.system("python -m pip install --upgrade 'jaraco.classes'") print("\n*** Installing more-itertools: *** (For PyPI uploads)\n") os.system("python -m pip install --upgrade 'more-itertools'") - print("\n*** Installing zipp: *** (Required for PyPI uploads)\n") - os.system("python -m pip install --upgrade 'zipp'") - print("\n*** Installing importlib-metadata: *** (For PyPI uploads)\n") - os.system("python -m pip install --upgrade 'importlib-metadata'") print("\n*** Installing keyring, requests-toolbelt: *** (For PyPI)\n") os.system("python -m pip install --upgrade keyring requests-toolbelt") print("\n*** Installing twine: *** (Required for PyPI uploads)\n") @@ -153,7 +149,7 @@ 'pip>=25.1.1;python_version>="3.9"', 'packaging>=25.0', 'setuptools~=70.2;python_version<"3.10"', # Newer ones had issues - 'setuptools>=80.8.0;python_version>="3.10"', + 'setuptools>=80.9.0;python_version>="3.10"', 'wheel>=0.45.1', 'attrs>=25.3.0', "certifi>=2025.4.26", @@ -186,7 +182,7 @@ 'charset-normalizer>=3.4.2,<4', 'urllib3>=1.26.20,<2;python_version<"3.10"', 'urllib3>=1.26.20,<2.5.0;python_version>="3.10"', - 'requests==2.32.3', + 'requests==2.32.4', 'sniffio==1.3.1', 'h11==0.16.0', 'outcome==1.3.0.post0', @@ -205,7 +201,8 @@ 'iniconfig==2.1.0', 'pluggy==1.5.0;python_version<"3.9"', 'pluggy==1.6.0;python_version>="3.9"', - 'pytest==8.3.5', + 'pytest==8.3.5;python_version<"3.9"', + 'pytest==8.4.0;python_version>="3.9"', "pytest-html==4.0.2", # Newer ones had issues 'pytest-metadata==3.1.1', "pytest-ordering==0.6",