Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump flask from 2.3.3 to 3.0.0 #1199

Merged
merged 4 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Flask==2.3.3
werkzeug==2.3.7
Flask==3.0.0
coverage==7.3.1
argparse
Django>=2.0.6
Expand Down
2 changes: 1 addition & 1 deletion requirements/test_windows.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==2.3.3
Flask==3.0.0
coverage==7.3.1
argparse
pytest==7.4.2
Expand Down
6 changes: 3 additions & 3 deletions splinter/driver/flaskclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ def delete_all(self):

def all(self, verbose=False): # NOQA: A003
cookies = {}
for cookie in self.driver.cookie_jar:
for cookie in self.driver._cookies.values():
cookies[cookie.key] = cookie.value
return cookies

def __getitem__(self, item):
return self.driver.get_cookie(item).value

def __contains__(self, key):
for cookie in self.driver.cookie_jar:
for cookie in self.driver._cookies.values():
if cookie.key == key:
return True
return False

def __eq__(self, other_object):
if isinstance(other_object, dict):
cookies_dict = {c.key: c.value for c in self.driver.cookie_jar}
cookies_dict = {c.key: c.value for c in self.driver._cookies.values()}
return cookies_dict == other_object
return False

Expand Down
2 changes: 1 addition & 1 deletion tests/test_flaskclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def test_cookies_extra_parameters(self):
"""Cookie can be created with extra parameters."""
timestamp = int(time.time() + 120)
self.browser.cookies.add({"sha": "zam"}, expires=timestamp)
cookie = {c.key: c for c in self.browser._browser.cookie_jar}["sha"]
cookie = {c.key: c for c in self.browser._browser._cookies.values()}["sha"]
assert timestamp == int(cookie.expires.timestamp())


Expand Down