Skip to content

Commit

Permalink
Merge pull request #11 from bendichter/use-pytest
Browse files Browse the repository at this point in the history
use pytest in ci
  • Loading branch information
alejoe91 authored Dec 9, 2024
2 parents bfb5b47 + b303900 commit 794cccb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
name: Validation
name: Run Tests

on:
push:
branches: [main]
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
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
10 changes: 6 additions & 4 deletions validate_probes.py → tests.py
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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())

0 comments on commit 794cccb

Please sign in to comment.