Skip to content

Commit 91faf70

Browse files
authored
Running backup tests only in a cluster setup (#385)
* Running backup tests only in a cluster setup * Fix mypy version * Suppress mypy warnings * Suppress mypy warnings
1 parent 629b3d8 commit 91faf70

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repos:
3434
- id: flake8
3535

3636
- repo: https://github.com/pre-commit/mirrors-mypy
37-
rev: v0.991
37+
rev: v1.15.0
3838
hooks:
3939
- id: mypy
4040
files: ^arango/

arango/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def set_token(self, token: str) -> None:
464464
"verify_iat": True,
465465
"verify_exp": True,
466466
"verify_signature": False,
467-
},
467+
}, # type: ignore[arg-type]
468468
)
469469
except ExpiredSignatureError:
470470
raise JWTExpiredError("JWT token is expired")
@@ -554,7 +554,7 @@ def set_token(self, token: str) -> None:
554554
"verify_iat": True,
555555
"verify_exp": True,
556556
"verify_signature": False,
557-
},
557+
}, # type: ignore[arg-type]
558558
)
559559
except ExpiredSignatureError:
560560
raise JWTExpiredError("JWT token is expired")

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies = [
3838
"urllib3>=1.26.0",
3939
"requests",
4040
"requests_toolbelt",
41-
"PyJWT",
41+
"PyJWT>=2.10.0",
4242
"packaging>=23.1",
4343
]
4444

@@ -49,8 +49,8 @@ version = { attr = "arango.version.__version__" }
4949
dev = [
5050
"black==26.1.0",
5151
"flake8==7.3.0",
52-
"isort>=5.10.1",
53-
"mypy>=0.942",
52+
"isort==5.10.1",
53+
"mypy==1.15.0",
5454
"mock",
5555
"pre-commit>=2.17.0",
5656
"pytest>=7.1.1",
@@ -90,5 +90,6 @@ profile = "black"
9090
[tool.mypy]
9191
warn_return_any = true
9292
warn_unused_configs = true
93+
warn_unused_ignores = false
9394
ignore_missing_imports = true
9495
strict = true

tests/test_backup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
from packaging import version
23

34
from arango.errno import DATABASE_NOT_FOUND, FILE_NOT_FOUND, FORBIDDEN, HTTP_NOT_FOUND
45
from arango.exceptions import (
@@ -12,11 +13,17 @@
1213
from tests.helpers import assert_raises
1314

1415

15-
def test_backup_management(sys_db, bad_db, cluster, skip_tests):
16+
def test_backup_management(sys_db, bad_db, cluster, skip_tests, db_version):
1617
if "enterprise" in skip_tests:
1718
pytest.skip("Only for ArangoDB enterprise edition")
1819
if "backup" in skip_tests:
1920
pytest.skip("Skipping backup tests")
21+
if not cluster:
22+
pytest.skip("For simplicity, the backup API is only tested in cluster setups")
23+
if db_version < version.parse("3.12.0"):
24+
pytest.skip(
25+
"For simplicity, the backup API is only tested in the latest versions"
26+
)
2027

2128
# Test create backup "foo".
2229
result = sys_db.backup.create(

0 commit comments

Comments
 (0)