run tests on commit

pull/84/head
Stijn De Clercq 2021-08-08 20:40:50 +02:00
parent 445ca84834
commit 76df656128
8 changed files with 18 additions and 17 deletions

15
.github/workflows/test.yml vendored 100644
View File

@ -0,0 +1,15 @@
name: Deploy
on:
push:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9.5'
- run: pip3 install -r requirements.txt
- run: pytest tests

View File

@ -16,4 +16,5 @@ googletrans==4.0.0rc1
quart==0.15.1
Quart-CORS==0.5.0
attrs~=21.2.0
dacite~=1.6.0
dacite~=1.6.0
pytest==6.2.4

View File

View File

@ -1,7 +1,6 @@
import pytz
from data import schedule
from datetime import datetime
import pytz
import unittest
@ -17,11 +16,3 @@ class TestSchedule(unittest.TestCase):
self.assertFalse(holiday.has_passed(before))
self.assertFalse(holiday.has_passed(during))
self.assertTrue(holiday.has_passed(after))
def test_course_str(self):
course = schedule.Course("Test")
self.assertEqual(str(course), "Test")
def test_location_str(self):
location = schedule.Location("C", "B", "R")
self.assertEqual(str(location), "C B R")

View File

@ -1,6 +0,0 @@
import unittest
if __name__ == "__main__":
suite = unittest.TestLoader().discover('.', pattern="test_*.py")
unittest.TextTestRunner(verbosity=3).run(suite)