Run tests with pytest

This commit is contained in:
Miguel Grinberg
2021-06-06 12:05:21 +01:00
parent a82ed55f56
commit 8b4ebbd953
3 changed files with 9 additions and 10 deletions

View File

@@ -2,10 +2,10 @@ name: build
on: on:
push: push:
branches: branches:
- master - main
pull_request: pull_request:
branches: branches:
- master - main
jobs: jobs:
lint: lint:
name: lint name: lint

View File

@@ -1,7 +1,6 @@
import sys import sys
sys.path.insert(0, 'microdot') sys.path.insert(0, 'src')
sys.path.insert(1, 'microdot-asyncio')
sys.path.insert(2, 'tests/libs') sys.path.insert(2, 'tests/libs')
import unittest import unittest

12
tox.ini
View File

@@ -13,17 +13,17 @@ python =
[testenv] [testenv]
commands= commands=
pip install -e microdot pip install -e .
pip install -e microdot-asyncio pytest -p no:logging --cov=src --cov-branch --cov-report=term-missing
coverage run --branch --include="microdot*.py" -m unittest tests deps=
coverage report --show-missing pytest
deps=coverage pytest-cov
[testenv:flake8] [testenv:flake8]
deps= deps=
flake8 flake8
commands= commands=
flake8 --ignore=W503 --exclude tests/libs microdot microdot-asyncio tests flake8 --ignore=W503 --exclude tests/libs src tests
[testenv:upy] [testenv:upy]
whitelist_externals=sh whitelist_externals=sh