From 8a0e742abd3b6ca459f33956eb497bba2b30796d Mon Sep 17 00:00:00 2001 From: Ben Lopatin Date: Sat, 18 Dec 2021 15:01:44 -0500 Subject: [PATCH] Update tests to use pytest --- .github/workflows/test.yml | 22 +++++++++++++--------- requirements.txt | 2 ++ tox.ini | 4 +++- 3 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 requirements.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6188122..89504ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ name: Tests -on: [push, pull_request] +on: [ push, pull_request ] jobs: test: @@ -9,13 +9,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - py_version: ["3.7", "3.8", "3.9", "3.10"] + py_version: [ "3.7", "3.8", "3.9", "3.10" ] steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.py_version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.py_version }} - - name: Run tests - run: python setup.py test + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.py_version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.py_version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Run tests + run: pytest --cov=pydiscourse diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..811ee3c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +pytest==6.2.5 +pytest-cov==3.0.0 diff --git a/tox.ini b/tox.ini index df4376e..099b21a 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,9 @@ envlist = py37, py38, py39, py310 [testenv] setenv = PYTHONPATH = {toxinidir}:{toxinidir}/pydiscourse -commands = python setup.py test +commands = pytest {posargs} --cov=pydiscourse +deps = + -r{toxinidir}/requirements.txt [testenv:flake8] basepython=python