diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..833dcdb --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: Run Python Unit Tests + +on: + push: # Run on every push event + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.11] + steps: + - uses: actions/checkout@v3 # Checkout code from repository + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install -r requirements.txt + - name: Run tests + run: | + python -m pytest test/tests.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test/tests.py b/test/tests.py index c79fcc4..b840038 100644 --- a/test/tests.py +++ b/test/tests.py @@ -1,7 +1,16 @@ -from datetime import datetime, timezone, timedelta +from datetime import ( + datetime, + timezone, + timedelta +) import pytest -from main import app, calculate_timezone_offset, is_valid_timezone_format, datetime_to_requested_string_format +from main import ( + app, + calculate_timezone_offset, + is_valid_timezone_format, + datetime_to_requested_string_format +) @pytest.fixture()