Skip to content

Commit 7b264c2

Browse files
authored
Merge pull request #344 from opsmill/fac-fix-testcontainer-ver
fix(testing): remove version fixture
2 parents a96e547 + b8c4f9c commit 7b264c2

File tree

4 files changed

+47
-20
lines changed

4 files changed

+47
-20
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,6 @@ jobs:
288288
pip install invoke toml codecov
289289
- name: "Install Package"
290290
run: "poetry install --all-extras"
291-
- name: "Set environment variables for python_testcontainers"
292-
run: |
293-
echo INFRAHUB_TESTING_IMAGE_VER=latest >> $GITHUB_ENV
294291
- name: "Integration Tests"
295292
run: |
296293
poetry run pytest --cov infrahub_sdk tests/integration/

infrahub_sdk/testing/docker.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88

99
from .. import Config, InfrahubClient, InfrahubClientSync
1010

11-
INFRAHUB_VERSION = os.getenv("INFRAHUB_TESTING_IMAGE_VER", "latest")
11+
INFRAHUB_VERSION = os.getenv("INFRAHUB_TESTING_IMAGE_VER")
1212

1313

1414
def skip_version(min_infrahub_version: str | None = None, max_infrahub_version: str | None = None) -> bool:
1515
"""
1616
Check if a test should be skipped depending on infrahub version.
1717
"""
18+
if INFRAHUB_VERSION is None:
19+
return True
20+
1821
try:
1922
version = Version(INFRAHUB_VERSION)
2023
except InvalidVersion:
@@ -31,10 +34,6 @@ def skip_version(min_infrahub_version: str | None = None, max_infrahub_version:
3134

3235

3336
class TestInfrahubDockerClient(TestInfrahubDocker):
34-
@pytest.fixture(scope="class")
35-
def infrahub_version(self) -> str:
36-
return INFRAHUB_VERSION
37-
3837
@pytest.fixture(scope="class")
3938
def client(self, infrahub_port: int) -> InfrahubClient:
4039
return InfrahubClient(

poetry.lock

Lines changed: 42 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ pytest-xdist = "^3.3.1"
6464
types-python-slugify = "^8.0.0.3"
6565
invoke = "^2.2.0"
6666
towncrier = "^24.8.0"
67-
infrahub-testcontainers = "~1.1.9"
68-
67+
infrahub-testcontainers = { version = "^1.2.5", python = ">=3.10" }
6968
astroid = "~3.1"
7069

7170
[tool.poetry.extras]

0 commit comments

Comments
 (0)