Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Bump `schemathesis` to v3.31.0 and silence warnings on API tests (#4593)

Krystle Salazar870cc85b71ef
diff --git a/api/pdm.lock b/api/pdm.lock
index e509aee83..96226e164 100644
--- a/api/pdm.lock
+++ b/api/pdm.lock
@@ -743,6 +743,17 @@ files = [
{file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"},
]
+[[package]]
+name = "harfile"
+version = "0.3.0"
+requires_python = ">=3.8"
+summary = "Writer for HTTP Archive (HAR) files"
+groups = ["test"]
+files = [
+ {file = "harfile-0.3.0-py3-none-any.whl", hash = "sha256:ac11177e06c88c9553c8c73c16ab20428a176d1d2ebe00b41ce527ff0bdc47e6"},
+ {file = "harfile-0.3.0.tar.gz", hash = "sha256:23be8037e1296bb4787a15543a37835ed91f408c8296988f9ba022a44accad9e"},
+]
+
[[package]]
name = "httpcore"
version = "1.0.5"
@@ -795,7 +806,7 @@ files = [
[[package]]
name = "hypothesis"
-version = "6.100.1"
+version = "6.104.2"
requires_python = ">=3.8"
summary = "A library for property-based testing"
groups = ["test"]
@@ -804,8 +815,8 @@ dependencies = [
"sortedcontainers<3.0.0,>=2.1.0",
]
files = [
- {file = "hypothesis-6.100.1-py3-none-any.whl", hash = "sha256:3dacf6ec90e8d14aaee02cde081ac9a17d5b70105e45e6ac822db72052c0195b"},
- {file = "hypothesis-6.100.1.tar.gz", hash = "sha256:ebff09d7fa4f1fb6a855a812baf17e578b4481b7b70ec6d96496210d1a4c6c35"},
+ {file = "hypothesis-6.104.2-py3-none-any.whl", hash = "sha256:8b52b7e2462e552c75b819495d5cb6251a2b840accc79cf2ce52588004c915d9"},
+ {file = "hypothesis-6.104.2.tar.gz", hash = "sha256:6f2a1489bc8fe1c87ffd202707319b66ec46b2bc11faf6e0161e957b8b9b1eab"},
]
[[package]]
@@ -1655,19 +1666,19 @@ files = [
[[package]]
name = "schemathesis"
-version = "3.27.0"
+version = "3.31.0"
requires_python = ">=3.8"
summary = "Property-based testing framework for Open API and GraphQL based apps"
groups = ["test"]
dependencies = [
- "anyio<4",
"backoff<3.0,>=2.1.2",
"click<9.0,>=7.0",
"colorama<1.0,>=0.4",
+ "harfile<1.0,>=0.3.0",
"httpx<1.0,>=0.22.0",
"hypothesis-graphql<1,>=0.11.0",
"hypothesis-jsonschema<0.24,>=0.23.1",
- "hypothesis<7,>=6.84.3; python_version > \"3.8\"",
+ "hypothesis<7,>=6.103.4; python_version > \"3.8\"",
"jsonschema<5.0,>=4.18.0",
"junit-xml<2.0,>=1.9",
"pyrate-limiter<4.0,>=2.10",
@@ -1675,7 +1686,7 @@ dependencies = [
"pytest<9,>=4.6.4",
"pyyaml<7.0,>=5.1",
"requests<3,>=2.22",
- "starlette-testclient<1",
+ "starlette-testclient<1,>=0.4.1",
"starlette<1,>=0.13",
"tomli-w<2.0,>=1.0.0",
"tomli<3.0,>=2.0.1",
@@ -1683,8 +1694,8 @@ dependencies = [
"yarl<2.0,>=1.5",
]
files = [
- {file = "schemathesis-3.27.0-py3-none-any.whl", hash = "sha256:d17dfbf0f1e085b14199e831fdc5d524ded7f461e0bdc9b18446e9ad29ff6495"},
- {file = "schemathesis-3.27.0.tar.gz", hash = "sha256:15ce5e2bf8a9c3cce425022db30fd506f241272fd99daec45ba4f491e5a8ea3e"},
+ {file = "schemathesis-3.31.0-py3-none-any.whl", hash = "sha256:1a05b8d15ced5065e22a60fa9f1d2bca79aa3207634949561108273a457fee5f"},
+ {file = "schemathesis-3.31.0.tar.gz", hash = "sha256:334068ff2d39f6bad46cd61e6e1fb64e55042da9fc727a5ba8d5e2789fbf73a6"},
]
[[package]]
@@ -1824,7 +1835,7 @@ files = [
[[package]]
name = "starlette-testclient"
-version = "0.3.0"
+version = "0.4.1"
requires_python = ">=3.7"
summary = "A backport of Starlette TestClient using requests! ⏪️"
groups = ["test"]
@@ -1833,8 +1844,8 @@ dependencies = [
"starlette>=0.20.1",
]
files = [
- {file = "starlette_testclient-0.3.0-py3-none-any.whl", hash = "sha256:84306a5ca443f81b2d5e838071ed175e9f1ece4ff0806b94778f5122b1c57ee6"},
- {file = "starlette_testclient-0.3.0.tar.gz", hash = "sha256:31c28c10abd240beb327ef1ee4dc395403c87da07d4665126b7d3c7b60444e04"},
+ {file = "starlette_testclient-0.4.1-py3-none-any.whl", hash = "sha256:dcf0eb237dc47f062ef5925f98330af46f67e547cb587119c9ae78c17ae6c1d1"},
+ {file = "starlette_testclient-0.4.1.tar.gz", hash = "sha256:9e993ffe12fab45606116257813986612262fe15c1bb6dc9e39cc68693ac1fc5"},
]
[[package]]
diff --git a/api/test/unit/controllers/test_search_controller.py b/api/test/unit/controllers/test_search_controller.py
index 6344e2144..2e4b9d650 100644
--- a/api/test/unit/controllers/test_search_controller.py
+++ b/api/test/unit/controllers/test_search_controller.py
@@ -1,7 +1,7 @@
-import datetime
import random
import re
from collections.abc import Callable
+from datetime import datetime, timezone
from enum import Enum, auto
from unittest import mock
from unittest.mock import patch
@@ -858,7 +858,7 @@ def test_get_excluded_sources_query_returns_excluded(
else:
for i in range(excluded_count):
ContentSourceFactory.create(
- created_on=datetime.datetime.now(),
+ created_on=datetime.now(tz=timezone.utc),
source_identifier=f"source{i + 1}",
source_name=f"Source {i + 1}",
filter_content=True,