From 863cc4e854da69acba8626c37814913bb67fd79d Mon Sep 17 00:00:00 2001 From: Jair Henrique Date: Sun, 10 Dec 2023 21:17:15 -0300 Subject: [PATCH] Run tests without tox --- .github/workflows/main.yml | 12 ++++++------ setup.py | 40 ++++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9804d86d2..4c94e54b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,19 +25,19 @@ jobs: - name: Install project dependencies run: | - pip3 install --upgrade pip - pip3 install codecov tox tox-gh-actions + pip install --upgrade pip + pip install codecov .[tests] - - name: Run online tests with tox - run: tox -- -m online + - name: Run online tests + run: ./runtests.sh --cov=./vcr --cov-branch --cov-report=xml --cov-append -m online - - name: Run offline tests with tox with no access to the Internet + - name: Run offline tests with no access to the Internet run: | # We're using unshare to take Internet access # away from tox so that we'll notice whenever some new test # is missing @pytest.mark.online decoration in the future unshare --map-root-user --net -- \ - sh -c 'ip link set lo up; tox -- -m "not online"' + sh -c 'ip link set lo up; ./runtests.sh --cov=./vcr --cov-branch --cov-report=xml --cov-append -m "not online" - name: Run coverage run: codecov diff --git a/setup.py b/setup.py index 71ba6a249..10325e72f 100644 --- a/setup.py +++ b/setup.py @@ -57,24 +57,26 @@ def run_tests(self): "urllib3 <2; platform_python_implementation =='PyPy'", ] -tests_require = [ - "aiohttp", - "boto3", - "httplib2", - "httpx", - "pytest", - "pytest-aiohttp", - "pytest-httpbin", - "requests>=2.16.2", - "tornado", - # Needed to un-break httpbin 0.7.0. For httpbin >=0.7.1 and after, - # this pin and the dependency itself can be removed, provided - # that the related bug in httpbin has been fixed: - # https://github.com/kevin1024/vcrpy/issues/645#issuecomment-1562489489 - # https://github.com/postmanlabs/httpbin/issues/673 - # https://github.com/postmanlabs/httpbin/pull/674 - "Werkzeug==2.0.3", -] +tests_require = { + "tests": [ + "aiohttp", + "boto3", + "httplib2", + "httpx", + "pytest", + "pytest-aiohttp", + "pytest-httpbin", + "requests>=2.22.0", + "tornado", + # Needed to un-break httpbin 0.7.0. For httpbin >=0.7.1 and after, + # this pin and the dependency itself can be removed, provided + # that the related bug in httpbin has been fixed: + # https://github.com/kevin1024/vcrpy/issues/645#issuecomment-1562489489 + # https://github.com/postmanlabs/httpbin/issues/673 + # https://github.com/postmanlabs/httpbin/pull/674 + "Werkzeug==2.0.3", + ], +} setup( name="vcrpy", @@ -89,7 +91,7 @@ def run_tests(self): python_requires=">=3.8", install_requires=install_requires, license="MIT", - tests_require=tests_require, + extras_require=tests_require, classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console",