Skip to content

Commit 3cf1352

Browse files
authored
Merge pull request #3806 from seleniumbase/update-dependencies-and-refactor
Update dependencies and refactor
2 parents 5e8095a + 1daed8a commit 3cf1352

File tree

5 files changed

+29
-22
lines changed

5 files changed

+29
-22
lines changed

requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pip>=25.0.1;python_version<"3.9"
22
pip>=25.1.1;python_version>="3.9"
33
packaging>=25.0
44
setuptools~=70.2;python_version<"3.10"
5-
setuptools>=80.8.0;python_version>="3.10"
5+
setuptools>=80.9.0;python_version>="3.10"
66
wheel>=0.45.1
77
attrs>=25.3.0
88
certifi>=2025.4.26
@@ -35,7 +35,7 @@ chardet==5.2.0
3535
charset-normalizer>=3.4.2,<4
3636
urllib3>=1.26.20,<2;python_version<"3.10"
3737
urllib3>=1.26.20,<2.5.0;python_version>="3.10"
38-
requests==2.32.3
38+
requests==2.32.4
3939
sniffio==1.3.1
4040
h11==0.16.0
4141
outcome==1.3.0.post0
@@ -54,7 +54,8 @@ execnet==2.1.1
5454
iniconfig==2.1.0
5555
pluggy==1.5.0;python_version<"3.9"
5656
pluggy==1.6.0;python_version>="3.9"
57-
pytest==8.3.5
57+
pytest==8.3.5;python_version<"3.9"
58+
pytest==8.4.0;python_version>="3.9"
5859
pytest-html==4.0.2
5960
pytest-metadata==3.1.1
6061
pytest-ordering==0.6

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.39.2"
2+
__version__ = "4.39.3"

seleniumbase/fixtures/base_case.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4592,9 +4592,9 @@ def load_cookies(self, name="cookies.txt", expiry=False):
45924592
Loads the page cookies from the "saved_cookies" folder.
45934593
Usage for setting expiry:
45944594
If expiry == 0 or False: Delete "expiry".
4595+
If expiry is True: Set "expiry" to 24 hours in the future.
45954596
If expiry == -1 (or < 0): Do not modify "expiry".
45964597
If expiry > 0: Set "expiry" to expiry minutes in the future.
4597-
If expiry == True: Set "expiry" to 24 hours in the future.
45984598
"""
45994599
cookies = self.get_saved_cookies(name)
46004600
self.wait_for_ready_state_complete()
@@ -4606,12 +4606,12 @@ def load_cookies(self, name="cookies.txt", expiry=False):
46064606
cookie["domain"] = trim_origin
46074607
if "expiry" in cookie and (not expiry or expiry == 0):
46084608
del cookie["expiry"]
4609+
elif expiry is True:
4610+
cookie["expiry"] = int(time.time()) + 86400
46094611
elif isinstance(expiry, (int, float)) and expiry < 0:
46104612
pass
46114613
elif isinstance(expiry, (int, float)) and expiry > 0:
46124614
cookie["expiry"] = int(time.time()) + int(expiry * 60.0)
4613-
elif expiry:
4614-
cookie["expiry"] = int(time.time()) + 86400
46154615
self.driver.add_cookie(cookie)
46164616

46174617
def delete_all_cookies(self):
@@ -4693,9 +4693,9 @@ def add_cookie(self, cookie_dict, expiry=False):
46934693
self.add_cookie({'name': 'foo', 'value': 'bar', 'sameSite': 'Strict'})
46944694
Usage for setting expiry:
46954695
If expiry == 0 or False: Delete "expiry".
4696+
If expiry is True: Set "expiry" to 24 hours in the future.
46964697
If expiry == -1 (or < 0): Do not modify "expiry".
46974698
If expiry > 0: Set "expiry" to expiry minutes in the future.
4698-
If expiry == True: Set "expiry" to 24 hours in the future.
46994699
"""
47004700
self.__check_scope()
47014701
self._check_browser()
@@ -4707,21 +4707,21 @@ def add_cookie(self, cookie_dict, expiry=False):
47074707
cookie["domain"] = trim_origin
47084708
if "expiry" in cookie and (not expiry or expiry == 0):
47094709
del cookie["expiry"]
4710+
elif expiry is True:
4711+
cookie["expiry"] = int(time.time()) + 86400
47104712
elif isinstance(expiry, (int, float)) and expiry < 0:
47114713
pass
47124714
elif isinstance(expiry, (int, float)) and expiry > 0:
47134715
cookie["expiry"] = int(time.time()) + int(expiry * 60.0)
4714-
elif expiry:
4715-
cookie["expiry"] = int(time.time()) + 86400
47164716
self.driver.add_cookie(cookie_dict)
47174717

47184718
def add_cookies(self, cookies, expiry=False):
47194719
"""
47204720
Usage for setting expiry:
47214721
If expiry == 0 or False: Delete "expiry".
4722+
If expiry is True: Set "expiry" to 24 hours in the future.
47224723
If expiry == -1 (or < 0): Do not modify "expiry".
47234724
If expiry > 0: Set "expiry" to expiry minutes in the future.
4724-
If expiry == True: Set "expiry" to 24 hours in the future.
47254725
"""
47264726
self.__check_scope()
47274727
self._check_browser()
@@ -4733,12 +4733,12 @@ def add_cookies(self, cookies, expiry=False):
47334733
cookie["domain"] = trim_origin
47344734
if "expiry" in cookie and (not expiry or expiry == 0):
47354735
del cookie["expiry"]
4736+
elif expiry is True:
4737+
cookie["expiry"] = int(time.time()) + 86400
47364738
elif isinstance(expiry, (int, float)) and expiry < 0:
47374739
pass
47384740
elif isinstance(expiry, (int, float)) and expiry > 0:
47394741
cookie["expiry"] = int(time.time()) + int(expiry * 60.0)
4740-
elif expiry:
4741-
cookie["expiry"] = int(time.time()) + 86400
47424742
self.driver.add_cookie(cookie)
47434743

47444744
def __set_esc_skip(self):

seleniumbase/plugins/pytest_plugin.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,7 +2160,12 @@ def _perform_pytest_unconfigure_(config):
21602160
from seleniumbase.core import proxy_helper
21612161

21622162
reporter = config.pluginmanager.get_plugin("terminalreporter")
2163-
duration = time.time() - reporter._sessionstarttime
2163+
start_time = None
2164+
if hasattr(reporter, "_sessionstarttime"):
2165+
start_time = reporter._sessionstarttime # (pytest < 8.4.0)
2166+
else:
2167+
start_time = reporter._session_start.time # (pytest >= 8.4.0)
2168+
duration = time.time() - start_time
21642169
if (
21652170
(hasattr(sb_config, "multi_proxy") and not sb_config.multi_proxy)
21662171
or not hasattr(sb_config, "multi_proxy")
@@ -2497,7 +2502,11 @@ def pytest_unconfigure(config):
24972502
if "--co" in sys_argv or "--collect-only" in sys_argv:
24982503
return
24992504
reporter = config.pluginmanager.get_plugin("terminalreporter")
2500-
if not hasattr(reporter, "_sessionstarttime"):
2505+
if (
2506+
not hasattr(reporter, "_sessionstarttime")
2507+
and not hasattr(reporter, "_session_start")
2508+
and not hasattr(reporter._session_start, "time")
2509+
):
25012510
return
25022511
if hasattr(sb_config, "_multithreaded") and sb_config._multithreaded:
25032512
import fasteners

setup.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@
5656
os.system("python -m pip install --upgrade 'jaraco.classes'")
5757
print("\n*** Installing more-itertools: *** (For PyPI uploads)\n")
5858
os.system("python -m pip install --upgrade 'more-itertools'")
59-
print("\n*** Installing zipp: *** (Required for PyPI uploads)\n")
60-
os.system("python -m pip install --upgrade 'zipp'")
61-
print("\n*** Installing importlib-metadata: *** (For PyPI uploads)\n")
62-
os.system("python -m pip install --upgrade 'importlib-metadata'")
6359
print("\n*** Installing keyring, requests-toolbelt: *** (For PyPI)\n")
6460
os.system("python -m pip install --upgrade keyring requests-toolbelt")
6561
print("\n*** Installing twine: *** (Required for PyPI uploads)\n")
@@ -153,7 +149,7 @@
153149
'pip>=25.1.1;python_version>="3.9"',
154150
'packaging>=25.0',
155151
'setuptools~=70.2;python_version<"3.10"', # Newer ones had issues
156-
'setuptools>=80.8.0;python_version>="3.10"',
152+
'setuptools>=80.9.0;python_version>="3.10"',
157153
'wheel>=0.45.1',
158154
'attrs>=25.3.0',
159155
"certifi>=2025.4.26",
@@ -186,7 +182,7 @@
186182
'charset-normalizer>=3.4.2,<4',
187183
'urllib3>=1.26.20,<2;python_version<"3.10"',
188184
'urllib3>=1.26.20,<2.5.0;python_version>="3.10"',
189-
'requests==2.32.3',
185+
'requests==2.32.4',
190186
'sniffio==1.3.1',
191187
'h11==0.16.0',
192188
'outcome==1.3.0.post0',
@@ -205,7 +201,8 @@
205201
'iniconfig==2.1.0',
206202
'pluggy==1.5.0;python_version<"3.9"',
207203
'pluggy==1.6.0;python_version>="3.9"',
208-
'pytest==8.3.5',
204+
'pytest==8.3.5;python_version<"3.9"',
205+
'pytest==8.4.0;python_version>="3.9"',
209206
"pytest-html==4.0.2", # Newer ones had issues
210207
'pytest-metadata==3.1.1',
211208
"pytest-ordering==0.6",

0 commit comments

Comments
 (0)