From 315ed2872de83413786e4f7e8da49d97d44808d5 Mon Sep 17 00:00:00 2001 From: hussein-awala Date: Fri, 2 Feb 2024 21:08:25 +0100 Subject: [PATCH 1/5] Upgrade pytest to v8 --- dev/breeze/README.md | 2 +- dev/breeze/pyproject.toml | 4 ++-- docker_tests/pyproject.toml | 2 +- docker_tests/requirements.txt | 2 +- kubernetes_tests/pyproject.toml | 2 +- pyproject.toml | 5 ++--- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dev/breeze/README.md b/dev/breeze/README.md index 6d235e56b971f..96faccc223190 100644 --- a/dev/breeze/README.md +++ b/dev/breeze/README.md @@ -66,6 +66,6 @@ PLEASE DO NOT MODIFY THE HASH BELOW! IT IS AUTOMATICALLY UPDATED BY PRE-COMMIT. --------------------------------------------------------------------------------------------------------- -Package config hash: f22d0c615925c3accb40fc1cf0ca5dc9ca57719968df55f12e96383bc5072113aef6d785565ae33f2f73889388ba2a2136a010f5dbfe12fe3cb90bc88c058bcb +Package config hash: a1034e5ed5ebdf58b83034854c49de368b2963182759cce323a25c70a122872eb1b77b33000d0eaf4f243428779eb33c8ff5f6067a88e4459a18e0c0e5cd4c31 --------------------------------------------------------------------------------------------------------- diff --git a/dev/breeze/pyproject.toml b/dev/breeze/pyproject.toml index 6984f829be63d..5ddfa9925957e 100644 --- a/dev/breeze/pyproject.toml +++ b/dev/breeze/pyproject.toml @@ -60,7 +60,7 @@ dependencies = [ "psutil>=5.9.6", "pygithub>=2.1.1", "pytest-xdist>=3.3.1", - "pytest>=7.4.4", + "pytest>=8.0.0", "pyyaml>=6.0.1", "requests>=2.31.0", "rich-click>=1.7.1", @@ -81,7 +81,7 @@ line-length = 110 target-version = ['py37', 'py38', 'py39', 'py310'] [tool.pytest.ini_options] -addopts = "-rasl --verbosity=2 -p no:flaky -p no:nose -p no:legacypath" +addopts = "-rasl --verbosity=2 -p no:flaky -p no:legacypath" norecursedirs = [ ".eggs", ] diff --git a/docker_tests/pyproject.toml b/docker_tests/pyproject.toml index 21f3b5c11995c..815529de571f6 100644 --- a/docker_tests/pyproject.toml +++ b/docker_tests/pyproject.toml @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. [tool.pytest.ini_options] -addopts = "-rasl --verbosity=2 -p no:flaky -p no:nose -p no:legacypath" +addopts = "-rasl --verbosity=2 -p no:flaky -p no:legacypath" norecursedirs = [ ".eggs", ] diff --git a/docker_tests/requirements.txt b/docker_tests/requirements.txt index 9a062566632eb..03037225a5de3 100644 --- a/docker_tests/requirements.txt +++ b/docker_tests/requirements.txt @@ -1,3 +1,3 @@ -pytest>=7.4.4 +pytest>=8.0.0 pytest-xdist requests diff --git a/kubernetes_tests/pyproject.toml b/kubernetes_tests/pyproject.toml index 21f3b5c11995c..815529de571f6 100644 --- a/kubernetes_tests/pyproject.toml +++ b/kubernetes_tests/pyproject.toml @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. [tool.pytest.ini_options] -addopts = "-rasl --verbosity=2 -p no:flaky -p no:nose -p no:legacypath" +addopts = "-rasl --verbosity=2 -p no:flaky -p no:legacypath" norecursedirs = [ ".eggs", ] diff --git a/pyproject.toml b/pyproject.toml index c083fe9a19fc5..bfd42e349b473 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -339,7 +339,7 @@ devel-tests = [ "pytest-rerunfailures>=13.0", "pytest-timeouts>=1.2.1", "pytest-xdist>=3.5.0", - "pytest>=7.4.4", + "pytest>=8.0.0", "requests_mock>=1.11.0", "time-machine>=2.13.0", ] @@ -1298,9 +1298,8 @@ docstring-code-format = true [tool.pytest.ini_options] # * Disable `flaky` plugin for pytest. This plugin conflicts with `rerunfailures` because provide same marker. -# * Disable `nose` builtin plugin for pytest. This feature deprecated in 7.2 and will be removed in pytest>=8 # * And we focus on use native pytest capabilities rather than adopt another frameworks. -addopts = "-rasl --verbosity=2 -p no:flaky -p no:nose --asyncio-mode=strict" +addopts = "-rasl --verbosity=2 -p no:flaky --asyncio-mode=strict" norecursedirs = [ ".eggs", "airflow", From 6ce9b5e6e252fc1131000140881af22cad9c73eb Mon Sep 17 00:00:00 2001 From: hussein-awala Date: Sat, 10 Feb 2024 23:47:33 +0100 Subject: [PATCH 2/5] bump pytest-asyncio to 0.23.5 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3689d7aacd9cf..5c7edfa91d4bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -330,7 +330,7 @@ devel-tests = [ "backports.zoneinfo>=0.2.1;python_version<'3.9'", "beautifulsoup4>=4.7.1", "coverage>=7.2", - "pytest-asyncio>=0.23.3", + "pytest-asyncio>=0.23.5", "pytest-cov>=4.1.0", "pytest-httpx>=0.21.3", "pytest-icdiff>=0.9", From 6370ce48e7bdf902d80d43dc10c6cbdb0ef60d42 Mon Sep 17 00:00:00 2001 From: hussein-awala Date: Tue, 13 Feb 2024 22:15:07 +0100 Subject: [PATCH 3/5] fix test_format_time_uses_tz_aware test --- tests/utils/log/test_colored_log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils/log/test_colored_log.py b/tests/utils/log/test_colored_log.py index e90029361f67c..34cf09db1fa0c 100644 --- a/tests/utils/log/test_colored_log.py +++ b/tests/utils/log/test_colored_log.py @@ -32,7 +32,7 @@ def test_format_time_uses_tz_aware(mock_fmt): # get a logger that uses CustomTTYColoredFormatter logger = logging.getLogger("test_format_time") h = logging.StreamHandler() - h.setFormatter(CustomTTYColoredFormatter()) + h.setFormatter(CustomTTYColoredFormatter(fmt="%(asctime)s: %(log_color)s%(message)s%(reset)s")) logger.addHandler(h) # verify that it uses TimezoneAware.formatTime From e68837424095ef8544d996b2f2a895562156daf3 Mon Sep 17 00:00:00 2001 From: hussein-awala Date: Sat, 16 Mar 2024 02:10:54 +0100 Subject: [PATCH 4/5] bump to 8.1.1 --- dev/breeze/README.md | 2 +- dev/breeze/pyproject.toml | 2 +- docker_tests/requirements.txt | 2 +- pyproject.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/breeze/README.md b/dev/breeze/README.md index e4d91eb9deca8..4f5f1009267a7 100644 --- a/dev/breeze/README.md +++ b/dev/breeze/README.md @@ -66,6 +66,6 @@ PLEASE DO NOT MODIFY THE HASH BELOW! IT IS AUTOMATICALLY UPDATED BY PRE-COMMIT. --------------------------------------------------------------------------------------------------------- -Package config hash: 2e8b9ed7a0ef30c79f6ebe5997a0422c05eac147a2340aac04c798fcecea0754f4a37a657ca50cc4c403cf624bec0fa964593ef012fe350783d102471ecd9afe +Package config hash: e1d1047618912d5060bf5d5dec84a8ab0104875f2fde1e30f4afbb05f7d8370b1fe364e86419bde87ec5be15a4a6aa4ce5f5ca46e411b98546f19ba28b128b21 --------------------------------------------------------------------------------------------------------- diff --git a/dev/breeze/pyproject.toml b/dev/breeze/pyproject.toml index 5278312b7a9f4..79e6cc1c5499a 100644 --- a/dev/breeze/pyproject.toml +++ b/dev/breeze/pyproject.toml @@ -63,7 +63,7 @@ dependencies = [ "psutil>=5.9.6", "pygithub>=2.1.1", "pytest-xdist>=3.3.1", - "pytest>=8.0.0", + "pytest>=8.1.1", "pyyaml>=6.0.1", "requests>=2.31.0", "rich-click>=1.7.1", diff --git a/docker_tests/requirements.txt b/docker_tests/requirements.txt index 03037225a5de3..d29c6bd1b51b1 100644 --- a/docker_tests/requirements.txt +++ b/docker_tests/requirements.txt @@ -1,3 +1,3 @@ -pytest>=8.0.0 +pytest>=8.1.1 pytest-xdist requests diff --git a/pyproject.toml b/pyproject.toml index 6d56b72c68a6a..35a190128af47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -356,7 +356,7 @@ devel-tests = [ "pytest-rerunfailures>=13.0", "pytest-timeouts>=1.2.1", "pytest-xdist>=3.5.0", - "pytest>=8.0.0", + "pytest>=8.1.1", "requests_mock>=1.11.0", "time-machine>=2.13.0", "wheel>=0.42.0", From 789c99aa46d34307e6adf2dd291ebe8faa2c3062 Mon Sep 17 00:00:00 2001 From: hussein-awala Date: Sat, 16 Mar 2024 13:55:11 +0100 Subject: [PATCH 5/5] fix fab tests --- tests/providers/fab/auth_manager/test_security.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/providers/fab/auth_manager/test_security.py b/tests/providers/fab/auth_manager/test_security.py index fecd5c442865c..79d08f9b45ed4 100644 --- a/tests/providers/fab/auth_manager/test_security.py +++ b/tests/providers/fab/auth_manager/test_security.py @@ -1117,13 +1117,14 @@ def test_update_user_auth_stat_subsequent_unsuccessful_auth(mock_security_manage def test_users_can_be_found(app, security_manager, session, caplog): """Test that usernames are case insensitive""" + existing_users = security_manager.get_all_users() create_user(app, "Test") create_user(app, "test") create_user(app, "TEST") create_user(app, "TeSt") assert security_manager.find_user("Test") users = security_manager.get_all_users() - assert len(users) == 1 + assert len(users) == 1 + len(existing_users) delete_user(app, "Test") assert "Error adding new user to database" in caplog.text