Skip to content

Commit a56f923

Browse files
committed
Test more docker images (5.0, 6.0 and 7.0)
1 parent 79e23bf commit a56f923

File tree

1 file changed

+73
-1
lines changed

1 file changed

+73
-1
lines changed

tests/test_versions.py

+73-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,50 @@
44
from .utils import run_command_in_container
55

66

7+
@pytest.mark.image_70
8+
@pytest.mark.parametrize(
9+
'command,expected_output',
10+
[
11+
# python
12+
('python2 --version', 'Python 2.7.18'),
13+
('python3.5 --version', 'Python 3.5.10'),
14+
('python3.6 --version', 'Python 3.6.12'),
15+
('python3.7 --version', 'Python 3.7.9'),
16+
('python3.8 --version', 'Python 3.8.6'),
17+
('pypy3.5 --version', 'Python 3.5.3 (928a4f70d3de7d17449456946154c5da6e600162, Feb 09 2019, 11:50:43)\n[PyPy 7.0.0 with GCC 8.2.0]'),
18+
# pip
19+
('python2 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/2.7.18/lib/python3.5/site-packages/pip (python 3.5)"),
20+
('python3.5 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.5.10/lib/python3.5/site-packages/pip (python 3.5)"),
21+
('python3.6 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.6.12/lib/python3.6/site-packages/pip (python 3.6)"),
22+
('python3.7 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/pip (python 3.7)"),
23+
('python3.8 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.8.6/lib/python3.8/site-packages/pip (python 3.8)"),
24+
# setuptools
25+
('python2 -c "import setuptools; print(setuptools.__version__)"', "44.0.0"),
26+
('python3.5 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"),
27+
('python3.6 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"),
28+
('python3.7 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"),
29+
('python3.8 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"),
30+
# virtualenv
31+
('python2 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.7.16/lib/python2.7/site-packages/virtualenv/__init__.pyc'),
32+
('python3.5 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.5.10/lib/python3.5/site-packages/virtualenv/__init__.pyc'),
33+
('python3.6 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.6.12/lib/python3.6/site-packages/virtualenv/__init__.pyc'),
34+
('python3.7 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/virtualenv/__init__.pyc'),
35+
('python3.8 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.8.6/lib/python3.8/site-packages/virtualenv/__init__.pyc'),
36+
# others
37+
('node --version', 'v8.10.0'),
38+
('npm --version', '3.5.2'),
39+
('conda --version', 'conda 4.6.14'),
40+
]
41+
)
42+
def test_command_versions_image_70(command, expected_output):
43+
cmd_output = run_command_in_container('readthedocs/build:7.0', command)
44+
assert cmd_output == expected_output
45+
46+
747
@pytest.mark.image_60
848
@pytest.mark.parametrize(
949
'command,expected_output',
1050
[
11-
# TODO: add other Docker images as well
1251
# python
1352
('python2 --version', 'Python 2.7.18'),
1453
('python3.5 --version', 'Python 3.5.10'),
@@ -17,6 +56,7 @@
1756
('python3.8 --version', 'Python 3.8.6'),
1857
('pypy3.5 --version', 'Python 3.5.3 (928a4f70d3de7d17449456946154c5da6e600162, Feb 09 2019, 11:50:43)\n[PyPy 7.0.0 with GCC 8.2.0]'),
1958
# pip
59+
('python2 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/2.7.18/lib/python3.5/site-packages/pip (python 3.5)"),
2060
('python3.5 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/3.5.10/lib/python3.5/site-packages/pip (python 3.5)"),
2161
('python3.6 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/3.6.12/lib/python3.6/site-packages/pip (python 3.6)"),
2262
('python3.7 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/pip (python 3.7)"),
@@ -42,3 +82,35 @@
4282
def test_command_versions_image_60(command, expected_output):
4383
cmd_output = run_command_in_container('readthedocs/build:6.0', command)
4484
assert cmd_output == expected_output
85+
86+
87+
@pytest.mark.image_50
88+
@pytest.mark.parametrize(
89+
'command,expected_output',
90+
[
91+
# python
92+
('python2 --version', 'Python 2.7.18'),
93+
('python3.6 --version', 'Python 3.6.12'),
94+
('python3.7 --version', 'Python 3.7.9'),
95+
('pypy3.5 --version', 'Python 3.5.3 (928a4f70d3de7d17449456946154c5da6e600162, Feb 09 2019, 11:50:43)\n[PyPy 7.0.0 with GCC 8.2.0]'),
96+
# pip
97+
('python2 -m pip --version', "pip 19.1.1 from /home/docs/.pyenv/versions/2.7.18/lib/python2.7/site-packages/pip (python 2.7)"),
98+
('python3.6 -m pip --version', "pip 19.1.1 from /home/docs/.pyenv/versions/3.6.12/lib/python3.6/site-packages/pip (python 3.6)"),
99+
('python3.7 -m pip --version', "pip 19.1.1 from /home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/pip (python 3.7)"),
100+
# setuptools
101+
('python2 -c "import setuptools; print(setuptools.__version__)"', "41.0.1"),
102+
('python3.6 -c "import setuptools; print(setuptools.__version__)"', "41.0.1"),
103+
('python3.7 -c "import setuptools; print(setuptools.__version__)"', "41.0.1"),
104+
# virtualenv
105+
('python2 -m virtualenv --version', '16.6.0'),
106+
('python3.6 -m virtualenv --version', '16.6.0'),
107+
('python3.7 -m virtualenv --version', '16.6.0'),
108+
# others
109+
('node --version', 'v8.10.0'),
110+
('npm --version', '3.5.2'),
111+
('conda --version', 'conda 4.6.14'),
112+
]
113+
)
114+
def test_command_versions_image_50(command, expected_output):
115+
cmd_output = run_command_in_container('readthedocs/build:5.0', command)
116+
assert cmd_output == expected_output

0 commit comments

Comments
 (0)