From 8b4ebbd9535b3c083fb2a955284609acba07f05e Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Sun, 6 Jun 2021 12:05:21 +0100 Subject: [PATCH] Run tests with pytest --- .github/workflows/tests.yml | 4 ++-- run_tests.py | 3 +-- tox.ini | 12 ++++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0671ac..f71d215 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,10 +2,10 @@ name: build on: push: branches: - - master + - main pull_request: branches: - - master + - main jobs: lint: name: lint diff --git a/run_tests.py b/run_tests.py index e676952..3d6a1d3 100644 --- a/run_tests.py +++ b/run_tests.py @@ -1,7 +1,6 @@ import sys -sys.path.insert(0, 'microdot') -sys.path.insert(1, 'microdot-asyncio') +sys.path.insert(0, 'src') sys.path.insert(2, 'tests/libs') import unittest diff --git a/tox.ini b/tox.ini index 7454699..b3b567f 100644 --- a/tox.ini +++ b/tox.ini @@ -13,17 +13,17 @@ python = [testenv] commands= - pip install -e microdot - pip install -e microdot-asyncio - coverage run --branch --include="microdot*.py" -m unittest tests - coverage report --show-missing -deps=coverage + pip install -e . + pytest -p no:logging --cov=src --cov-branch --cov-report=term-missing +deps= + pytest + pytest-cov [testenv:flake8] deps= flake8 commands= - flake8 --ignore=W503 --exclude tests/libs microdot microdot-asyncio tests + flake8 --ignore=W503 --exclude tests/libs src tests [testenv:upy] whitelist_externals=sh