Skip to content

Commit b6b0e0d

Browse files
committed
Run tests without tox
1 parent 796dc8d commit b6b0e0d

File tree

2 files changed

+48
-33
lines changed

2 files changed

+48
-33
lines changed

.github/workflows/main.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8", "pypy-3.9", "pypy-3.10"]
16+
python-version:
17+
[
18+
"3.8",
19+
"3.9",
20+
"3.10",
21+
"3.11",
22+
"3.12",
23+
"pypy-3.8",
24+
"pypy-3.9",
25+
"pypy-3.10",
26+
]
1727

1828
steps:
1929
- uses: actions/checkout@v4
@@ -25,19 +35,19 @@ jobs:
2535

2636
- name: Install project dependencies
2737
run: |
28-
pip3 install --upgrade pip
29-
pip3 install codecov tox tox-gh-actions
30-
31-
- name: Run online tests with tox
32-
run: tox -- -m online
33-
34-
- name: Run offline tests with tox with no access to the Internet
35-
run: |
36-
# We're using unshare to take Internet access
37-
# away from tox so that we'll notice whenever some new test
38-
# is missing @pytest.mark.online decoration in the future
39-
unshare --map-root-user --net -- \
40-
sh -c 'ip link set lo up; tox -- -m "not online"'
38+
pip install --upgrade pip
39+
pip install codecov .[tests]
40+
41+
- name: Run tests
42+
run: ./runtests.sh --cov=./vcr --cov-branch --cov-report=xml --cov-append
43+
44+
# - name: Run offline tests with no access to the Internet
45+
# run: |
46+
# # We're using unshare to take Internet access
47+
# # away from tox so that we'll notice whenever some new test
48+
# # is missing @pytest.mark.online decoration in the future
49+
# unshare --map-root-user --net -- \
50+
# sh -c 'ip link set lo up; ./runtests.sh --cov=./vcr --cov-branch --cov-report=xml --cov-append -m "not online"'
4151

4252
- name: Run coverage
4353
run: codecov

setup.py

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,29 @@ def run_tests(self):
5757
"urllib3 <2; platform_python_implementation =='PyPy'",
5858
]
5959

60-
tests_require = [
61-
"aiohttp",
62-
"boto3",
63-
"httplib2",
64-
"httpx",
65-
"pytest",
66-
"pytest-aiohttp",
67-
"pytest-httpbin",
68-
"requests>=2.16.2",
69-
"tornado",
70-
# Needed to un-break httpbin 0.7.0. For httpbin >=0.7.1 and after,
71-
# this pin and the dependency itself can be removed, provided
72-
# that the related bug in httpbin has been fixed:
73-
# https://github.com/kevin1024/vcrpy/issues/645#issuecomment-1562489489
74-
# https://github.com/postmanlabs/httpbin/issues/673
75-
# https://github.com/postmanlabs/httpbin/pull/674
76-
"Werkzeug==2.0.3",
77-
]
60+
tests_require = {
61+
"tests": [
62+
"aiohttp",
63+
"boto3",
64+
"httplib2",
65+
"httpx",
66+
"pytest-aiohttp",
67+
"pytest-asyncio",
68+
"pytest-cov",
69+
"pytest-httpbin",
70+
"pytest",
71+
"requests>=2.22.0",
72+
"tornado",
73+
"urllib3",
74+
# Needed to un-break httpbin 0.7.0. For httpbin >=0.7.1 and after,
75+
# this pin and the dependency itself can be removed, provided
76+
# that the related bug in httpbin has been fixed:
77+
# https://github.com/kevin1024/vcrpy/issues/645#issuecomment-1562489489
78+
# https://github.com/postmanlabs/httpbin/issues/673
79+
# https://github.com/postmanlabs/httpbin/pull/674
80+
"Werkzeug==2.0.3",
81+
],
82+
}
7883

7984
setup(
8085
name="vcrpy",
@@ -89,7 +94,7 @@ def run_tests(self):
8994
python_requires=">=3.8",
9095
install_requires=install_requires,
9196
license="MIT",
92-
tests_require=tests_require,
97+
extras_require=tests_require,
9398
classifiers=[
9499
"Development Status :: 5 - Production/Stable",
95100
"Environment :: Console",

0 commit comments

Comments
 (0)