Skip to content

Commit

Permalink
Bump flask from 2.3.3 to 3.0.0 (#1199)
Browse files Browse the repository at this point in the history
* Bump flask from 2.3.3 to 3.0.0

Bumps [flask](https://github.com/pallets/flask) from 2.3.3 to 3.0.0.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
- [Commits](pallets/flask@2.3.3...3.0.0)

---
updated-dependencies:
- dependency-name: flask
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* requirements/test: bump werkzeug too

* requirements/test: remove werkzeug

Let pip resolve it from Flask.

* Fix compatibility with Werkzeug 3.0

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: francisco souza <[email protected]>
  • Loading branch information
dependabot[bot] and fsouza authored Oct 3, 2023
1 parent 3c2c01a commit ac22280
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
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

0 comments on commit ac22280

Please sign in to comment.