Skip to content

Commit ed2f732

Browse files
authored
add python tests (#11)
* 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
1 parent c4c5162 commit ed2f732

File tree

5 files changed

+118
-1
lines changed

5 files changed

+118
-1
lines changed

.github/workflows/test.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,32 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v1
1111
- uses: max/secret-scan@master
12+
python:
13+
name: Python tests
14+
runs-on: ubuntu-latest
15+
strategy:
16+
max-parallel: 4
17+
matrix:
18+
python-version: [3.6, 3.7]
19+
steps:
20+
- uses: actions/checkout@v1
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install pipenv
29+
pipenv sync --dev
30+
- name: Lint with mypy
31+
run: |
32+
find ${GITHUB_WORKSPACE} -name '*.py' ! -name '*_types.py' -exec pipenv run mypy {} +
33+
- name: Lint with flake8
34+
run: |
35+
pipenv run flake8 --exclude=tests ${GITHUB_WORKSPACE} --count --show-source --statistics
36+
- name: Lint with pylint
37+
run: |
38+
find ${GITHUB_WORKSPACE} -name '*.py' | xargs pipenv run pylint --rcfile=.pylintrc
39+
- name: Test with pytest
40+
run: pipenv run pytest

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
"moto",
115115
"mountpoint",
116116
"mssql",
117+
"mypy",
117118
"nacl",
118119
"nargs",
119120
"networklb",
@@ -141,6 +142,7 @@
141142
"pyinstaller",
142143
"pylint",
143144
"pylintrc",
145+
"pytest",
144146
"qrcode",
145147
"quickstart",
146148
"rcfile",
@@ -193,6 +195,7 @@
193195
"weirdnesses",
194196
"whichenv",
195197
"winrm",
198+
"xargs",
196199
"xenial",
197200
"xlarge",
198201
"xrange",

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ pylint = "~= 2.0"
1616
# python3 flake8-docstrings fails with pydocstyle 4:
1717
# https://github.com/PyCQA/pydocstyle/issues/375
1818
pydocstyle = '<4.0.0'
19+
pytest = '~= 5.1'

Pipfile.lock

Lines changed: 80 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/test_placeholder.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""A placeholder for tests."""
2+
3+
4+
def test_placeholder() -> None:
5+
"""Placeholder for tests."""

0 commit comments

Comments
 (0)