diff --git a/requirements.txt b/requirements.txt index 802a333..a438298 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,8 @@ -flask~=3.0.3 -flask_cors~=4.0.1 +flask~=3.1.0 +flask_cors~=5.0.1 requests==2.32.3 PyShExC~=0.9.1 chardet~=5.2.0 jsonasobj~=1.3.1 -setuptools~=71.1.0 \ No newline at end of file +setuptools~=78.1.0 +antlr4-python3-runtime==4.9.3 diff --git a/test_schemas.py b/test_schemas.py index 00cebd3..ff5312e 100644 --- a/test_schemas.py +++ b/test_schemas.py @@ -1,6 +1,7 @@ """ Tests to test wikidata entityschemas against wikidata items """ +import time import unittest import requests @@ -15,11 +16,12 @@ class MyTestCase(unittest.TestCase): def setUp(self) -> None: app.config["TESTING"] = True + app.config['DEBUG'] = False self.app = app.test_client() def tearDown(self) -> None: - # We don't need to tear anything down after the test - pass + # Wait before performing the next test to avoid running into Wikidata's request limits when using Github Actions + time.sleep(4) def test_specific_wikidata_item_against_schema(self): """ @@ -73,8 +75,12 @@ def test_wikidata_entityschemas(self) -> None: with self.subTest(schema=schema): if schema in skips: self.skipTest(f"Schema {schema} not supported") + # Wait before performing the next test to avoid running into Wikidata's request limits when using Github Actions + time.sleep(4) response = self.app.get(f'/api/v2?entityschema={schema}&entity=Q100532807&language=en', follow_redirects=True) + if response.status_code == 429: + self.skipTest("Wikidata is giving a 429 (too many requests) response") self.assertEqual(response.status_code, 200) def test_specific_entityschema(self) -> None: