Skip to content

Commit

Permalink
Run tests without tox
Browse files Browse the repository at this point in the history
  • Loading branch information
jairhenrique committed Dec 11, 2023
1 parent 796dc8d commit 863cc4e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
40 changes: 21 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 863cc4e

Please sign in to comment.