Skip to content

Commit 935d8ea

Browse files
committed
Set up tests and linters
1 parent ec785c4 commit 935d8ea

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ mypy = "^0.931"
2222
[build-system]
2323
requires = ["poetry-core>=1.0.0"]
2424
build-backend = "poetry.core.masonry.api"
25+
26+
[tool.mypy]
27+
ignore_missing_imports = true

tests/__init__.py

Whitespace-only changes.

tests/test_cobhan.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Tests for the main Cobhan module"""
2+
3+
from unittest import TestCase
4+
5+
6+
class CobhanTest(TestCase):
7+
"""Tests for the main Cobhan class"""
8+
9+
def test_pass(self):
10+
"""Fake test to start off"""
11+
self.assertEqual(True, True)

tox.ini

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[tox]
2+
minversion = 3.7.0
3+
toxworkdir = {env:TOX_WORK_DIR:.tox}
4+
skip_missing_interpreters = True
5+
envlist = py{37,38,39,310},black,mypy,pylint
6+
parallel_show_output = True
7+
isolated_build = True
8+
9+
[gh-actions]
10+
python =
11+
3.7: py37
12+
3.8: py38
13+
3.9: py39
14+
3.10: py310
15+
16+
[testenv]
17+
whitelist_externals =
18+
poetry
19+
pytest
20+
setenv =
21+
PYTHONDONTWRITEBYTECODE=1
22+
PYTHONHASHSEED=0
23+
PYTHONWARNINGS=ignore
24+
commands =
25+
poetry install --no-root -v
26+
poetry run pytest {posargs}
27+
28+
[testenv:black]
29+
basepython = python3.7
30+
commands =
31+
poetry install --no-root -v
32+
poetry run black --check .
33+
34+
[testenv:mypy]
35+
basepython = python3.7
36+
commands =
37+
poetry install --no-root -v
38+
poetry run mypy .
39+
40+
[testenv:pylint]
41+
basepython = python3.7
42+
commands =
43+
poetry install --no-root -v
44+
poetry run pylint cobhan/ tests/

0 commit comments

Comments
 (0)