Skip to content

Commit 8b043eb

Browse files
committed
fix(tests): restore gitlab_plan and related fixtures
Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
1 parent b5048a3 commit 8b043eb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/functional/conftest.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import pytest
2+
3+
import gitlab
4+
from gitlab.testing.fixtures.helpers import get_gitlab_plan
5+
6+
7+
@pytest.fixture(scope="session")
8+
def gitlab_plan(gl: gitlab.Gitlab) -> str | None:
9+
return get_gitlab_plan(gl)
10+
11+
12+
@pytest.fixture(autouse=True)
13+
def gitlab_premium(gitlab_plan, request) -> None:
14+
if gitlab_plan in ("premium", "ultimate"):
15+
return
16+
17+
if request.node.get_closest_marker("gitlab_premium"):
18+
pytest.skip("Test requires GitLab Premium plan")
19+
20+
21+
@pytest.fixture(autouse=True)
22+
def gitlab_ultimate(gitlab_plan, request) -> None:
23+
if gitlab_plan == "ultimate":
24+
return
25+
26+
if request.node.get_closest_marker("gitlab_ultimate"):
27+
pytest.skip("Test requires GitLab Ultimate plan")

0 commit comments

Comments
 (0)