Skip to content

Commit

Permalink
add python tests (#11)
Browse files Browse the repository at this point in the history
* add python tests

- includes a place holder test for check to pass
- test run on python 3.6 and 3.7
- include mypy, flake8, pylint, pytest
  • Loading branch information
ITProKyle authored Sep 2, 2019
1 parent c4c5162 commit ed2f732
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,32 @@ jobs:
steps:
- uses: actions/checkout@v1
- uses: max/secret-scan@master
python:
name: Python tests
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv sync --dev
- name: Lint with mypy
run: |
find ${GITHUB_WORKSPACE} -name '*.py' ! -name '*_types.py' -exec pipenv run mypy {} +
- name: Lint with flake8
run: |
pipenv run flake8 --exclude=tests ${GITHUB_WORKSPACE} --count --show-source --statistics
- name: Lint with pylint
run: |
find ${GITHUB_WORKSPACE} -name '*.py' | xargs pipenv run pylint --rcfile=.pylintrc
- name: Test with pytest
run: pipenv run pytest
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"moto",
"mountpoint",
"mssql",
"mypy",
"nacl",
"nargs",
"networklb",
Expand Down Expand Up @@ -141,6 +142,7 @@
"pyinstaller",
"pylint",
"pylintrc",
"pytest",
"qrcode",
"quickstart",
"rcfile",
Expand Down Expand Up @@ -193,6 +195,7 @@
"weirdnesses",
"whichenv",
"winrm",
"xargs",
"xenial",
"xlarge",
"xrange",
Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ pylint = "~= 2.0"
# python3 flake8-docstrings fails with pydocstyle 4:
# https://github.com/PyCQA/pydocstyle/issues/375
pydocstyle = '<4.0.0'
pytest = '~= 5.1'
81 changes: 80 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions tests/test_placeholder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""A placeholder for tests."""


def test_placeholder() -> None:
"""Placeholder for tests."""

0 comments on commit ed2f732

Please sign in to comment.