From f6b94c0ce3d05369963d430eb3b9d7e32b082e5d Mon Sep 17 00:00:00 2001 From: fengzero Date: Fri, 13 Oct 2023 07:28:44 +0000 Subject: [PATCH] ft env --- .github/workflows/check.yml | 2 +- tests/ft/conftest.py | 12 ++++++++++++ tests/ft/pytest.ini | 7 ++++++- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 tests/ft/conftest.py diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index fa3d54cf..be281b82 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -141,7 +141,7 @@ jobs: run: | pip install -U pytest pip install requests - pytest -s tests/ft + pytest -s -v tests/ft - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 diff --git a/tests/ft/conftest.py b/tests/ft/conftest.py new file mode 100644 index 00000000..da83e43f --- /dev/null +++ b/tests/ft/conftest.py @@ -0,0 +1,12 @@ +import pytest + + +def pytest_addoption(parser): + parser.addoption( + "--env", default="github", choices=["github", "test"], help="enviroment parameter" + ) + + +@pytest.fixture(autouse=True, scope="session") +def get_envx(request): + return request.config.getoption("--env") diff --git a/tests/ft/pytest.ini b/tests/ft/pytest.ini index 261d996b..cb32c5bd 100644 --- a/tests/ft/pytest.ini +++ b/tests/ft/pytest.ini @@ -1,3 +1,8 @@ [pytest] python_files = test_*.py -python_functions = test_* \ No newline at end of file +python_functions = test_* + +addopts = --strict-markers + +markers = + test : 'test'