From 5549ee08efa07202ba6bb2ad8064a232d86b1d16 Mon Sep 17 00:00:00 2001 From: PWZER Date: Wed, 29 Sep 2021 23:38:31 +0800 Subject: [PATCH] update test script --- .github/workflows/lint-and-pytest.yml | 4 ++-- README.md | 2 ++ requirements.txt | 2 -- test/requirements.txt | 11 +++++++++++ tox.ini | 26 ++++++++++++-------------- 5 files changed, 27 insertions(+), 18 deletions(-) delete mode 100644 requirements.txt create mode 100644 test/requirements.txt diff --git a/.github/workflows/lint-and-pytest.yml b/.github/workflows/lint-and-pytest.yml index e896a70..db55e5f 100644 --- a/.github/workflows/lint-and-pytest.yml +++ b/.github/workflows/lint-and-pytest.yml @@ -1,4 +1,4 @@ -name: Python Package using Conda +name: tests on: [push, pull_request] @@ -15,6 +15,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - run: python setup.py install - - run: pip install flake8 pytest requests uvicorn tornado flask falcon aiohttp bottle sanic quart starlette + - run: pip install flake8 -r test/requirements.txt - run: flake8 - run: pytest -s test/ diff --git a/README.md b/README.md index 791d9cf..205623b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![tests](https://github.com/PWZER/swagger-ui-py/actions/workflows/lint-and-pytest.yml/badge.svg) + # swagger-ui-py Swagger UI for Python web framework, such Tornado, Flask, Quart, aiohttp, Sanic and Falcon. diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e3870c5..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -jinja2>=2.0 -PyYaml>=5.0 diff --git a/test/requirements.txt b/test/requirements.txt new file mode 100644 index 0000000..785a597 --- /dev/null +++ b/test/requirements.txt @@ -0,0 +1,11 @@ +pytest +requests +uvicorn +tornado +flask +falcon +aiohttp +bottle +sanic +quart +starlette diff --git a/tox.ini b/tox.ini index c311a74..6f20ee8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,15 @@ [tox] -envlist = py39,py38 +envlist = py38,py39 [testenv] -deps = - pytest - requests - uvicorn - tornado - flask - falcon - aiohttp - bottle - sanic - quart - starlette -commands = pytest test/ +extras = flake8, pytest + +[testenv:flake8] +commands = + pip install flake8 + flake8 . + +[testenv:pytest] +commands = + pip install -r test/requirements.txt + pytest -s test/