diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3bd5f62..e36f10d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,10 @@ jobs: run: cd python && pip install -e . - name: Install packages needed for tests run: pip install pytest pytest-asyncio pytest-cov boto3 kachery_cloud + - name: Run non-api tests + run: cd python && pytest -m "not api" tests/ # make sure we are not depending on any of the additional packages in requirements.txt + - name: Install packages needed for api tests + run: pip install -r requirements.txt - name: Run tests and collect coverage run: cd python && pytest --cov protocaas --cov-report=xml --cov-report=term tests/ - uses: codecov/codecov-action@v3 diff --git a/python/pytest.ini b/python/pytest.ini new file mode 100644 index 0000000..9a40183 --- /dev/null +++ b/python/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +markers = + api: tests for api that require the api packages to be installed \ No newline at end of file diff --git a/python/tests/test_api.py b/python/tests/test_api.py index f9b6def..9106439 100644 --- a/python/tests/test_api.py +++ b/python/tests/test_api.py @@ -7,6 +7,7 @@ @pytest.mark.asyncio +@pytest.mark.api async def test_api(): from protocaas.api_helpers.routers.gui.project_routes import create_project, CreateProjectRequest from protocaas.api_helpers.routers.gui.project_routes import set_project_name, SetProjectNameRequest