forked from ansible/awx
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert swagger release fixture to env var (ansible#14940)
`pytest awx/main/tests/docs --release=$(VERSION_TARGET)` where --release is required breaks test discovery and running in vscode (from within the container)
- Loading branch information
1 parent
c5b4fb0
commit 3c7a8b1
Showing
2 changed files
with
6 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
from awx.main.tests.functional.conftest import * # noqa | ||
import os | ||
import pytest | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption("--release", action="store", help="a release version number, e.g., 3.3.0") | ||
|
||
|
||
def pytest_generate_tests(metafunc): | ||
# This is called for every test. Only get/set command line arguments | ||
# if the argument is specified in the list of test "fixturenames". | ||
option_value = metafunc.config.option.release | ||
if 'release' in metafunc.fixturenames and option_value is not None: | ||
metafunc.parametrize("release", [option_value]) | ||
@pytest.fixture() | ||
def release(): | ||
return os.environ.get('VERSION_TARGET', '') |