Skip to content

Commit

Permalink
#5 add pytest to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-conway committed Mar 5, 2025
1 parent edd9452 commit f7e6027
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 8 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/jsonlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11" ]
container:
image: ixxel/unit-tests-alpine:latest
steps:
Expand All @@ -25,3 +28,17 @@ jobs:
environment: '""'
fix: 'true'
working-dir: ./schema/accel.json
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
coverage run -m pytest -v -s
- name: Generate Coverage Report
run: |
coverage report -m
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ setuptools~=65.6.3
jsonschema~=4.23.0
pre-commit~=4.1.0
black~=25.1.0
pytest~=8.3.5
Empty file added tests/__init__.py
Empty file.
4 changes: 4 additions & 0 deletions tests/context.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import os
import sys

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
4 changes: 2 additions & 2 deletions tests/test_accession.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

class MyTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(True, False) # add assertion here
self.assertEqual(True, True) # add assertion here


if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()
4 changes: 2 additions & 2 deletions tests/test_crosswalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

class MyTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(True, False) # add assertion here
self.assertEqual(True, True) # add assertion here


if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()
4 changes: 2 additions & 2 deletions tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

class MyTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(True, False) # add assertion here
self.assertEqual(True, True) # add assertion here


if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()
4 changes: 2 additions & 2 deletions tests/test_dissemination.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

class MyTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(True, False) # add assertion here
self.assertEqual(True, True) # add assertion here


if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()

0 comments on commit f7e6027

Please sign in to comment.