diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-27 20:28:15 +0100 |
---|---|---|
committer | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-27 21:08:47 +0100 |
commit | 6b892e3dcb18d0f43da6020b08fd4ba891da3670 (patch) | |
tree | e97beaaca3b5b94764f78e0fd99df0c53fd19f8b /tests/functional/conftest.py | |
parent | 70b9870f929c4db32fd2e1406db2122de9958bfd (diff) | |
download | gitlab-test/cli-coverage.tar.gz |
test(cli): improve basic CLI coveragetest/cli-coverage
Diffstat (limited to 'tests/functional/conftest.py')
-rw-r--r-- | tests/functional/conftest.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py index b6fb9ed..854a273 100644 --- a/tests/functional/conftest.py +++ b/tests/functional/conftest.py @@ -9,6 +9,11 @@ import pytest import gitlab +@pytest.fixture(scope="session") +def fixture_dir(test_dir): + return test_dir / "functional" / "fixtures" + + def reset_gitlab(gl): # previously tools/reset_gitlab.py for project in gl.projects.list(): @@ -27,7 +32,7 @@ def reset_gitlab(gl): def set_token(container, rootdir): - set_token_rb = rootdir / "fixtures" / "set_token.rb" + set_token_rb = rootdir / "set_token.rb" with open(set_token_rb, "r") as f: set_token_command = f.read().strip() @@ -68,13 +73,8 @@ def temp_dir(): @pytest.fixture(scope="session") -def test_dir(pytestconfig): - return pytestconfig.rootdir / "tests" / "functional" - - -@pytest.fixture(scope="session") -def docker_compose_file(test_dir): - return test_dir / "fixtures" / "docker-compose.yml" +def docker_compose_file(fixture_dir): + return fixture_dir / "docker-compose.yml" @pytest.fixture(scope="session") @@ -129,7 +129,7 @@ def wait_for_sidekiq(gl): @pytest.fixture(scope="session") -def gitlab_config(check_is_alive, docker_ip, docker_services, temp_dir, test_dir): +def gitlab_config(check_is_alive, docker_ip, docker_services, temp_dir, fixture_dir): config_file = temp_dir / "python-gitlab.cfg" port = docker_services.port_for("gitlab", 80) @@ -137,7 +137,7 @@ def gitlab_config(check_is_alive, docker_ip, docker_services, temp_dir, test_dir timeout=200, pause=5, check=lambda: check_is_alive("gitlab-test") ) - token = set_token("gitlab-test", rootdir=test_dir) + token = set_token("gitlab-test", rootdir=fixture_dir) config = f"""[global] default = local |