Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Based on https://github.com/marketplace/actions/python-poetry-action

name: Run tests

on:
- push

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"

- name: Install poetry
uses: abatilo/actions-poetry@v4

- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local

- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
run: poetry install

- name: Run tests
run: poetry run pytest -vv
2 changes: 1 addition & 1 deletion tests/armis_sdk/entities/sites_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def test_get_sites(from_response, expected, httpx_mock: pytest_httpx.HTTPX
async def test_get_sites_with_multiple_pages(
monkeypatch, httpx_mock: pytest_httpx.HTTPXMock
):
monkeypatch.setenv("ARMIS_PAGE_SIZE", 2)
monkeypatch.setenv("ARMIS_PAGE_SIZE", "2")
httpx_mock.add_response(
url="https://mock_tenant.armis.com/api/v1/sites/?from=0&length=2",
method="GET",
Expand Down
Loading