Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mariofix committed May 8, 2023
1 parent 8b3cdd9 commit 6dea70f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/tests.yml
Expand Up @@ -10,17 +10,31 @@ on:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
tests:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

poetry-version: ["1.4.2"]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Set Up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install Thank You
run: poetry install --with dev
- uses: pre-commit/action@v3.0.0
- uses: pre-commit-ci/lite-action@v1.0.1
if: always()
- name: Run Tests and coverage
run: poetry run coverage run -m pytest
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2
24 changes: 22 additions & 2 deletions pyproject.toml
Expand Up @@ -27,12 +27,32 @@ classifiers=[
"Topic :: Software Development :: Libraries :: Python Modules",
]

[tool.poetry.build]
generate-setup-file = true

[tool.poetry.dependencies]
python = "^3.8"

[tool.poetry.group.dev]
optional = true


[tool.poetry.group.dev.dependencies]
black = "^23.3.0"
flake8 = "^6.0.0"
black = "*"
flake8 = "*"
coverage = "*"
pytest = "*"
isort = "*"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra"
testpaths = [
"thankyou",
]
python_files =[
"test*.py"
]

[tool.poetry.scripts]
thanks = 'thankyou:give_thanks'
Expand Down
2 changes: 1 addition & 1 deletion thankyou/__init__.py
@@ -1,3 +1,3 @@
from .thankyou import give_thanks

__all__ = ["give_thanks"]
__all__ = ["give_thanks"]
6 changes: 6 additions & 0 deletions thankyou/tests.py
@@ -0,0 +1,6 @@
from .thankyou import give_thanks


def test_thanks():
thanks_string = give_thanks()
assert isinstance(thanks_string, str)

0 comments on commit 6dea70f

Please sign in to comment.