diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d03ef2..3a581cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Validation +name: Run Tests on: push: @@ -6,17 +6,21 @@ on: pull_request: branches: [main] - jobs: - validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install jsonschema requests - - name: Validate - run: | - python validate_probes.py \ No newline at end of file + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install jsonschema requests pytest + + - name: Run tests + run: | + python -m pytest tests.py -v diff --git a/validate_probes.py b/tests.py similarity index 80% rename from validate_probes.py rename to tests.py index ffe88c4..310edc0 100644 --- a/validate_probes.py +++ b/tests.py @@ -1,6 +1,8 @@ import glob -import jsonschema import json + +import jsonschema +import pytest import requests schema_url = "https://raw.githubusercontent.com/SpikeInterface/probeinterface/main/resources/probe.json.schema" @@ -10,9 +12,9 @@ files = glob.glob("*/*/*.json") -print("Validating the following files:") -for file in files: - print(file) + +@pytest.mark.parametrize("file", files) +def test_valid_probe_dict(file): with open(file) as f: data = json.load(f) jsonschema.validate(data, response.json()) \ No newline at end of file