Skip to content

Commit 794cccb

Browse files
authored
Merge pull request #11 from bendichter/use-pytest
use pytest in ci
2 parents bfb5b47 + b303900 commit 794cccb

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
name: Validation
1+
name: Run Tests
22

33
on:
44
push:
55
branches: [main]
66
pull_request:
77
branches: [main]
88

9-
109
jobs:
11-
validate:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-python@v5
16-
- name: Install dependencies
17-
run: |
18-
python -m pip install --upgrade pip
19-
pip install jsonschema requests
20-
- name: Validate
21-
run: |
22-
python validate_probes.py
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install jsonschema requests pytest
23+
24+
- name: Run tests
25+
run: |
26+
python -m pytest tests.py -v
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import glob
2-
import jsonschema
32
import json
3+
4+
import jsonschema
5+
import pytest
46
import requests
57

68
schema_url = "https://raw.githubusercontent.com/SpikeInterface/probeinterface/main/resources/probe.json.schema"
@@ -10,9 +12,9 @@
1012

1113
files = glob.glob("*/*/*.json")
1214

13-
print("Validating the following files:")
14-
for file in files:
15-
print(file)
15+
16+
@pytest.mark.parametrize("file", files)
17+
def test_valid_probe_dict(file):
1618
with open(file) as f:
1719
data = json.load(f)
1820
jsonschema.validate(data, response.json())

0 commit comments

Comments
 (0)