summaryrefslogtreecommitdiff
path: root/tools/functional/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/functional/conftest.py')
-rw-r--r--tools/functional/conftest.py27
1 files changed, 6 insertions, 21 deletions
diff --git a/tools/functional/conftest.py b/tools/functional/conftest.py
index bd99fa9..e12471b 100644
--- a/tools/functional/conftest.py
+++ b/tools/functional/conftest.py
@@ -1,3 +1,5 @@
+import os
+import tempfile
from random import randint
import pytest
@@ -5,6 +7,9 @@ import pytest
import gitlab
+TEMP_DIR = tempfile.gettempdir()
+
+
def random_id():
"""
Helper to ensure new resource creation does not clash with
@@ -17,27 +22,7 @@ def random_id():
@pytest.fixture(scope="session")
def CONFIG():
- return "/tmp/python-gitlab.cfg"
-
-
-@pytest.fixture
-def gitlab_cli(script_runner, CONFIG):
- """Wrapper fixture to help make test cases less verbose."""
-
- def _gitlab_cli(subcommands):
- """
- Return a script_runner.run method that takes a default gitlab
- command, and subcommands passed as arguments inside test cases.
- """
- command = ["gitlab", "--config-file", CONFIG]
-
- for subcommand in subcommands:
- # ensure we get strings (e.g from IDs)
- command.append(str(subcommand))
-
- return script_runner.run(*command)
-
- return _gitlab_cli
+ return os.path.join(TEMP_DIR, "python-gitlab.cfg")
@pytest.fixture(scope="session")