4
4
# shellcheck source=bin/default_pythons
5
5
source " bin/default_pythons"
6
6
7
- testPythonDefault () {
8
- updateVersion " pythonDefault" $DEFAULT_PYTHON_VERSION
9
- compile " pythonDefault"
10
- assertCaptured $DEFAULT_PYTHON_VERSION
7
+ testPythonVersionUnspecified () {
8
+ compile " python_version_unspecified"
9
+ assertCaptured " Installing ${DEFAULT_PYTHON_VERSION} "
11
10
assertNotCaptured " security update"
12
11
assertCaptured " Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
13
12
assertCaptured " Installing SQLite3"
14
13
assertCapturedSuccess
15
14
}
16
15
17
- testPython2 () {
18
- updateVersion " python2" $LATEST_27
19
- echo $LATEST_27 > " runtime.txt"
20
- compile " python2"
21
- assertCaptured $LATEST_27
22
- assertCaptured " python-2-7-eol-faq" ;
23
- assertNotCaptured " security update"
24
- assertCaptured " Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2"
25
- assertCaptured " Installing SQLite3"
26
- assertCapturedSuccess
16
+ testPython2_7 () {
17
+ compile " python2"
18
+ assertCaptured " Installing ${LATEST_27} "
19
+ assertCaptured " python-2-7-eol-faq" ;
20
+ assertNotCaptured " security update"
21
+ assertCaptured " Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2"
22
+ assertCaptured " Installing SQLite3"
23
+ assertCapturedSuccess
27
24
}
28
25
29
- testPython2_warn () {
30
- compile " python2_warn"
31
- assertCaptured " python-2.7.15"
32
- assertCaptured " python-2-7-eol-faq" ;
33
- assertCaptured " Only the latest version"
34
- assertCaptured " Installing SQLite3 "
35
- assertCapturedSuccess
26
+ testPython2_7_warn () {
27
+ compile " python2_warn"
28
+ assertCaptured " Installing python-2.7.15"
29
+ assertCaptured " python-2-7-eol-faq" ;
30
+ assertCaptured " Only the latest version"
31
+ assertCaptured " ${LATEST_27} "
32
+ assertCapturedSuccess
36
33
}
37
34
38
35
testPython3_4 () {
39
36
compile " python3_4"
40
- assertCaptured $ LATEST_34
37
+ assertCaptured " Installing ${ LATEST_34} "
41
38
assertNotCaptured " security update"
42
39
assertCaptured " Installing pip 19.1.1, setuptools 43.0.0 and wheel 0.33.6"
40
+ assertCaptured " Installing SQLite3"
43
41
# Can't use `assertCapturedSuccess` since Pip outputs a Python 3.4 EOL warning to stderr,
44
42
# and the newest Pip that works on Python 3.4 doesn't support `PIP_NO_PYTHON_VERSION_WARNING`.
45
43
assertCapturedSuccessWithStdErr
46
44
}
47
45
48
46
testPython3_4_warn () {
49
47
compile " python3_4_warn"
50
- assertCaptured " python-3.4.9"
48
+ assertCaptured " Installing python-3.4.9"
51
49
assertCaptured " security update!"
50
+ assertCaptured " ${LATEST_34} "
52
51
# Can't use `assertCapturedSuccess` since Pip outputs a Python 3.4 EOL warning to stderr,
53
52
# and the newest Pip that works on Python 3.4 doesn't support `PIP_NO_PYTHON_VERSION_WARNING`.
54
53
assertCapturedSuccessWithStdErr
55
54
}
56
55
57
56
testPython3_5 () {
58
57
compile " python3_5"
59
- assertCaptured $ LATEST_35
58
+ assertCaptured " Installing ${ LATEST_35} "
60
59
assertNotCaptured " security update"
61
60
assertCaptured " Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
62
61
assertCaptured " Installing SQLite3"
@@ -65,15 +64,15 @@ testPython3_5() {
65
64
66
65
testPython3_5_warn () {
67
66
compile " python3_5_warn"
68
- assertCaptured " python-3.5.6"
67
+ assertCaptured " Installing python-3.5.6"
69
68
assertCaptured " security update!"
69
+ assertCaptured " ${LATEST_35} "
70
70
assertCapturedSuccess
71
71
}
72
72
73
73
testPython3_6 () {
74
- updateVersion " python3_6" $LATEST_36
75
74
compile " python3_6"
76
- assertCaptured $ LATEST_36
75
+ assertCaptured " Installing ${ LATEST_36} "
77
76
assertNotCaptured " security update"
78
77
assertCaptured " Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
79
78
assertCaptured " Installing SQLite3"
@@ -82,62 +81,60 @@ testPython3_6() {
82
81
83
82
testPython3_6_warn () {
84
83
compile " python3_6_warn"
85
- assertCaptured " python-3.6.7"
84
+ assertCaptured " Installing python-3.6.7"
86
85
assertCaptured " security update!"
87
- assertCaptured " Installing SQLite3 "
86
+ assertCaptured " ${LATEST_36} "
88
87
assertCapturedSuccess
89
88
}
90
89
91
90
testPython3_7 () {
92
- updateVersion " python3_7" $LATEST_37
93
- compile " python3_7"
94
- if [[ $STACK = " cedar-14" ]]; then
95
- assertCapturedError
96
- else
97
- assertNotCaptured " security update"
98
- assertCaptured $LATEST_37
99
- assertCaptured " Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
100
- assertCaptured " Installing SQLite3"
101
- assertCapturedSuccess
91
+ # Python 3.7+ requires newer libssl than is present on Cedar-14.
92
+ if [[ " ${STACK} " = " cedar-14" ]]; then
93
+ return
102
94
fi
95
+ compile " python3_7"
96
+ assertCaptured " Installing ${LATEST_37} "
97
+ assertNotCaptured " security update"
98
+ assertCaptured " Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
99
+ assertCaptured " Installing SQLite3"
100
+ assertCapturedSuccess
103
101
}
104
102
105
103
testPython3_7_warn () {
106
- compile " python3_7_warn"
107
- if [[ $STACK = " cedar-14" ]]; then
108
- assertCapturedError
109
- else
110
- assertCaptured " python-3.7.1"
111
- assertCaptured " security update!"
112
- assertCaptured " Installing SQLite3"
113
- assertCapturedSuccess
104
+ # Python 3.7+ requires newer libssl than is present on Cedar-14.
105
+ if [[ " ${STACK} " = " cedar-14" ]]; then
106
+ return
114
107
fi
108
+ compile " python3_7_warn"
109
+ assertCaptured " Installing python-3.7.1"
110
+ assertCaptured " security update!"
111
+ assertCaptured " ${LATEST_37} "
112
+ assertCapturedSuccess
115
113
}
116
114
117
115
testPython3_8 () {
118
- updateVersion " python3_8" $LATEST_38
119
- compile " python3_8"
120
- if [[ $STACK = " cedar-14" ]]; then
121
- assertCapturedError
122
- else
123
- assertNotCaptured " security update"
124
- assertCaptured $LATEST_38
125
- assertCaptured " Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
126
- assertCaptured " Installing SQLite3"
127
- assertCapturedSuccess
116
+ # Python 3.7+ requires newer libssl than is present on Cedar-14.
117
+ if [[ " ${STACK} " = " cedar-14" ]]; then
118
+ return
128
119
fi
120
+ compile " python3_8"
121
+ assertCaptured " Installing ${LATEST_38} "
122
+ assertNotCaptured " security update"
123
+ assertCaptured " Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
124
+ assertCaptured " Installing SQLite3"
125
+ assertCapturedSuccess
129
126
}
130
127
131
128
testPython3_8_warn () {
132
- compile " python3_8_warn"
133
- if [[ $STACK = " cedar-14" ]]; then
134
- assertCapturedError
135
- else
136
- assertCaptured " python-3.8.0"
137
- assertCaptured " security update!"
138
- assertCaptured " Installing SQLite3"
139
- assertCapturedSuccess
129
+ # Python 3.7+ requires newer libssl than is present on Cedar-14.
130
+ if [[ " ${STACK} " = " cedar-14" ]]; then
131
+ return
140
132
fi
133
+ compile " python3_8_warn"
134
+ assertCaptured " Installing python-3.8.0"
135
+ assertCaptured " security update!"
136
+ assertCaptured " ${LATEST_38} "
137
+ assertCapturedSuccess
141
138
}
142
139
143
140
testPython3_9 () {
@@ -146,8 +143,8 @@ testPython3_9() {
146
143
return
147
144
fi
148
145
compile " python3_9"
146
+ assertCaptured " Installing ${LATEST_39} "
149
147
assertNotCaptured " security update"
150
- assertCaptured $LATEST_39
151
148
assertCaptured " Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
152
149
assertCaptured " Installing SQLite3"
153
150
assertCapturedSuccess
@@ -163,8 +160,9 @@ testPython3_9_warn() {
163
160
return
164
161
fi
165
162
compile " python3_9_warn"
166
- assertCaptured " python-3.9.0"
163
+ assertCaptured " Installing python-3.9.0"
167
164
assertCaptured " security update!"
165
+ assertCaptured " ${LATEST_39} "
168
166
assertCapturedSuccess
169
167
}
170
168
@@ -177,53 +175,44 @@ testPythonVersionInvalid() {
177
175
178
176
testPypy3_6 () {
179
177
compile " pypy3_6"
180
- assertCaptured " Installing pypy "
178
+ assertCaptured " Installing ${LATEST_PYPY_36} "
181
179
assertNotCaptured " security update"
182
- assertCaptured " $LATEST_PYPY_36 "
183
180
assertCaptured " Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
184
181
assertCapturedSuccess
185
182
}
186
183
187
184
testPypy3_6_warn () {
188
185
compile " pypy3_6_warn"
189
- if [[ $STACK = " cedar-14" ]]; then
190
- assertCapturedError
191
- else
192
- assertCaptured " Installing pypy"
193
- assertCaptured " security update!"
194
- assertCaptured " $LATEST_PYPY_36 "
195
- assertCapturedSuccess
196
- fi
186
+ assertCaptured " Installing pypy3.6-7.3.1"
187
+ assertCaptured " security update!"
188
+ assertCaptured " ${LATEST_PYPY_36} "
189
+ assertCapturedSuccess
197
190
}
198
191
199
192
testPypy2_7 () {
200
193
compile " pypy2_7"
201
- assertCaptured " Installing pypy "
194
+ assertCaptured " Installing ${LATEST_PYPY_27} "
202
195
assertNotCaptured " security update"
203
- assertCaptured " $LATEST_PYPY_27 "
204
196
assertCaptured " Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2"
205
197
assertCapturedSuccess
206
198
}
207
199
208
200
testPypy2_7_warn () {
209
201
compile " pypy2_7_warn"
210
- if [[ $STACK = " cedar-14" ]]; then
211
- assertCapturedError
212
- else
213
- assertCaptured " Installing pypy"
214
- assertCaptured " security update!"
215
- assertCaptured " $LATEST_PYPY_27 "
216
- assertCapturedSuccess
217
- fi
202
+ assertCaptured " Installing pypy2.7-7.3.1"
203
+ assertCaptured " security update!"
204
+ assertCaptured " ${LATEST_PYPY_27} "
205
+ assertCapturedSuccess
218
206
}
219
207
220
208
testStickyPythonVersion () {
221
209
local cache_dir=" $( mktmpdir) "
222
210
compile " python3_6_warn" " $cache_dir "
223
211
assertCaptured " Installing python-3.6.7"
224
212
assertCapturedSuccess
225
- compile " no-runtime-txt" " $cache_dir "
226
- assertCaptured " Installing python-3.6.7"
213
+ compile " python_version_unspecified" " $cache_dir "
214
+ assertNotCaptured " Installing python"
215
+ assertCaptured " security update!"
227
216
assertCapturedSuccess
228
217
# Whilst this file seems like an implementation detail (so something that should
229
218
# not be tested), we must guarantee the filename remains consistent for backwards
0 commit comments