| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 124abab commit 3e4781a
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,6 +12,7 @@ | |||
| 12 | 12 | import gitlab | |
| 13 | 13 | import gitlab.base | |
| 14 | 14 | from tests.functional import helpers | |
| 15 | + from tests.functional.fixtures.docker import * # noqa | ||
| 15 | 16 | ||
| 16 | 17 | SLEEP_TIME = 10 | |
| 17 | 18 | ||
@@ -34,11 +35,6 @@ def gitlab_version(gl) -> GitlabVersion: | |||
| 34 | 35 | return GitlabVersion(major=major, minor=minor, patch=patch, revision=revision) | |
| 35 | 36 | ||
| 36 | 37 | ||
| 37 | - @pytest.fixture(scope="session") | ||
| 38 | - def docker_compose_command(): | ||
| 39 | - return "docker compose" | ||
| 40 | - | ||
| 41 | - | ||
| 42 | 38 | @pytest.fixture(scope="session") | |
| 43 | 39 | def fixture_dir(test_dir) -> pathlib.Path: | |
| 44 | 40 | return test_dir / "functional" / "fixtures" | |
@@ -160,26 +156,6 @@ def temp_dir() -> pathlib.Path: | |||
| 160 | 156 | return pathlib.Path(tempfile.gettempdir()) | |
| 161 | 157 | ||
| 162 | 158 | ||
| 163 | - @pytest.fixture(scope="session") | ||
| 164 | - def docker_compose_file(fixture_dir): | ||
| 165 | - return fixture_dir / "docker-compose.yml" | ||
| 166 | - | ||
| 167 | - | ||
| 168 | - @pytest.fixture(scope="session") | ||
| 169 | - def docker_compose_project_name(): | ||
| 170 | - """Set a consistent project name to enable optional reuse of containers.""" | ||
| 171 | - return "pytest-python-gitlab" | ||
| 172 | - | ||
| 173 | - | ||
| 174 | - @pytest.fixture(scope="session") | ||
| 175 | - def docker_cleanup(request): | ||
| 176 | - """Conditionally keep containers around by overriding the cleanup command.""" | ||
| 177 | - if request.config.getoption("--keep-containers"): | ||
| 178 | - # Print version and exit. | ||
| 179 | - return "-v" | ||
| 180 | - return "down -v" | ||
| 181 | - | ||
| 182 | - | ||
| 183 | 159 | @pytest.fixture(scope="session") | |
| 184 | 160 | def check_is_alive(): | |
| 185 | 161 | """ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,30 @@ | |||
| 1 | + """ | ||
| 2 | + pytest-docker fixture overrides. | ||
| 3 | + See https://github.com/avast/pytest-docker#available-fixtures. | ||
| 4 | + """ | ||
| 5 | + import pytest | ||
| 6 | + | ||
| 7 | + | ||
| 8 | + @pytest.fixture(scope="session") | ||
| 9 | + def docker_compose_command(): | ||
| 10 | + return "docker compose" | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + @pytest.fixture(scope="session") | ||
| 14 | + def docker_compose_project_name(): | ||
| 15 | + """Set a consistent project name to enable optional reuse of containers.""" | ||
| 16 | + return "pytest-python-gitlab" | ||
| 17 | + | ||
| 18 | + | ||
| 19 | + @pytest.fixture(scope="session") | ||
| 20 | + def docker_compose_file(fixture_dir): | ||
| 21 | + return fixture_dir / "docker-compose.yml" | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + @pytest.fixture(scope="session") | ||
| 25 | + def docker_cleanup(request): | ||
| 26 | + """Conditionally keep containers around by overriding the cleanup command.""" | ||
| 27 | + if request.config.getoption("--keep-containers"): | ||
| 28 | + # Print version and exit. | ||
| 29 | + return "-v" | ||
| 30 | + return "down -v" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments