From ac222802c95972b41518993f136f75fc48e95282 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 00:44:00 -0400 Subject: [PATCH] Bump flask from 2.3.3 to 3.0.0 (#1199) * 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](https://github.com/pallets/flask/compare/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] * 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] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: francisco souza <108725+fsouza@users.noreply.github.com> --- requirements/test.txt | 3 +-- requirements/test_windows.txt | 2 +- splinter/driver/flaskclient.py | 6 +++--- tests/test_flaskclient.py | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/requirements/test.txt b/requirements/test.txt index 01abf80c2..76e72a7ac 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -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 diff --git a/requirements/test_windows.txt b/requirements/test_windows.txt index 2815d4de3..e1616d52b 100644 --- a/requirements/test_windows.txt +++ b/requirements/test_windows.txt @@ -1,4 +1,4 @@ -Flask==2.3.3 +Flask==3.0.0 coverage==7.3.1 argparse pytest==7.4.2 diff --git a/splinter/driver/flaskclient.py b/splinter/driver/flaskclient.py index 390a46a8e..0eb988f8f 100644 --- a/splinter/driver/flaskclient.py +++ b/splinter/driver/flaskclient.py @@ -36,7 +36,7 @@ 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 @@ -44,14 +44,14 @@ 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 diff --git a/tests/test_flaskclient.py b/tests/test_flaskclient.py index b58dec675..c8996f33c 100644 --- a/tests/test_flaskclient.py +++ b/tests/test_flaskclient.py @@ -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())