Skip to content

Commit ab76947

Browse files
committed
Adding utility for comparing versions.
1 parent 9d8d4c0 commit ab76947

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"PyJWT",
2525
"setuptools>=42",
2626
"importlib_metadata>=4.7.1",
27+
"packaging>=23.1",
2728
],
2829
extras_require={
2930
"dev": [

tests/conftest.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from dataclasses import dataclass
22

33
import pytest
4+
from packaging import version
45

56
from arango import ArangoClient, formatter
67
from arango.database import StandardDatabase
@@ -40,6 +41,7 @@ class GlobalData:
4041
enterprise: bool = None
4142
secret: str = None
4243
root_password: str = None
44+
db_version: version = version.parse("0.0.0")
4345

4446

4547
global_data = GlobalData()
@@ -66,7 +68,7 @@ def pytest_configure(config):
6668
password=config.getoption("passwd"),
6769
superuser_token=generate_jwt(secret),
6870
)
69-
sys_db.version()
71+
db_version = sys_db.version()
7072

7173
# Create a user and non-system database for testing.
7274
username = generate_username()
@@ -118,6 +120,7 @@ def pytest_configure(config):
118120
global_data.username = username
119121
global_data.password = password
120122
global_data.db_name = tst_db_name
123+
global_data.db_version = version.parse(db_version)
121124
global_data.sys_db = sys_db
122125
global_data.tst_db = tst_db
123126
global_data.bad_db = bad_db
@@ -247,6 +250,11 @@ def mock_verify_format(body, result):
247250
monkeypatch.setattr(formatter, "verify_format", mock_verify_format)
248251

249252

253+
@pytest.fixture(autouse=False)
254+
def db_version():
255+
return global_data.db_version
256+
257+
250258
@pytest.fixture(autouse=False)
251259
def url():
252260
return global_data.url

0 commit comments

Comments
 (0)