@@ -27,14 +27,21 @@ def next_tox_major():
2727 return "10.0.0"
2828
2929
30- def test_provision_min_version_is_requires (newconfig , next_tox_major ):
30+ @pytest .fixture (scope = "session" , params = ["minversion" , "min_version" ])
31+ def minversion_option (request ):
32+ """both possible names for the minversion config option"""
33+ return request .param
34+
35+
36+ def test_provision_min_version_is_requires (newconfig , minversion_option , next_tox_major ):
3137 with pytest .raises (MissingRequirement ) as context :
3238 newconfig (
3339 [],
3440 """\
3541 [tox]
36- minversion = {}
42+ {} = {}
3743 """ .format (
44+ minversion_option ,
3845 next_tox_major ,
3946 ),
4047 )
@@ -49,17 +56,20 @@ def test_provision_min_version_is_requires(newconfig, next_tox_major):
4956 assert config .ignore_basepython_conflict is False
5057
5158
52- def test_provision_config_has_minversion_and_requires (newconfig , next_tox_major ):
59+ def test_provision_config_has_minversion_and_requires (
60+ newconfig , minversion_option , next_tox_major
61+ ):
5362 with pytest .raises (MissingRequirement ) as context :
5463 newconfig (
5564 [],
5665 """\
5766 [tox]
58- minversion = {}
67+ {} = {}
5968 requires =
6069 setuptools > 2
6170 pip > 3
6271 """ .format (
72+ minversion_option ,
6373 next_tox_major ,
6474 ),
6575 )
@@ -89,17 +99,18 @@ def test_provision_tox_change_name(newconfig):
8999 assert config .provision_tox_env == "magic"
90100
91101
92- def test_provision_basepython_global_only (newconfig , next_tox_major ):
102+ def test_provision_basepython_global_only (newconfig , minversion_option , next_tox_major ):
93103 """we don't want to inherit basepython from global"""
94104 with pytest .raises (MissingRequirement ) as context :
95105 newconfig (
96106 [],
97107 """\
98108 [tox]
99- minversion = {}
109+ {} = {}
100110 [testenv]
101111 basepython = what
102112 """ .format (
113+ minversion_option ,
103114 next_tox_major ,
104115 ),
105116 )
@@ -108,17 +119,18 @@ def test_provision_basepython_global_only(newconfig, next_tox_major):
108119 assert base_python == sys .executable
109120
110121
111- def test_provision_basepython_local (newconfig , next_tox_major ):
122+ def test_provision_basepython_local (newconfig , minversion_option , next_tox_major ):
112123 """however adhere to basepython when explicitly set"""
113124 with pytest .raises (MissingRequirement ) as context :
114125 newconfig (
115126 [],
116127 """\
117128 [tox]
118- minversion = {}
129+ {} = {}
119130 [testenv:.tox]
120131 basepython = what
121132 """ .format (
133+ minversion_option ,
122134 next_tox_major ,
123135 ),
124136 )
@@ -199,14 +211,17 @@ def test_provision_does_not_fail_with_no_provision_no_reason(cmd, initproj, json
199211
200212
201213@parametrize_json_path
202- def test_provision_fails_with_no_provision_next_tox (cmd , initproj , next_tox_major , json_path ):
214+ def test_provision_fails_with_no_provision_next_tox (
215+ cmd , initproj , minversion_option , next_tox_major , json_path
216+ ):
203217 p = initproj (
204218 "test-0.1" ,
205219 {
206220 "tox.ini" : """\
207221 [tox]
208- minversion = {}
222+ {} = {}
209223 """ .format (
224+ minversion_option ,
210225 next_tox_major ,
211226 )
212227 },
@@ -238,17 +253,21 @@ def test_provision_fails_with_no_provision_missing_requires(cmd, initproj, json_
238253
239254
240255@parametrize_json_path
241- def test_provision_does_not_fail_with_satisfied_requires (cmd , initproj , next_tox_major , json_path ):
256+ def test_provision_does_not_fail_with_satisfied_requires (
257+ cmd , initproj , minversion_option , json_path
258+ ):
242259 p = initproj (
243260 "test-0.1" ,
244261 {
245262 "tox.ini" : """\
246263 [tox]
247- minversion = 0
264+ {} = 0
248265 requires =
249266 setuptools > 2
250267 pip > 3
251- """
268+ """ .format (
269+ minversion_option
270+ )
252271 },
253272 )
254273 result = cmd ("--no-provision" , * ([json_path ] if json_path else []))
@@ -257,17 +276,20 @@ def test_provision_does_not_fail_with_satisfied_requires(cmd, initproj, next_tox
257276
258277
259278@parametrize_json_path
260- def test_provision_fails_with_no_provision_combined (cmd , initproj , next_tox_major , json_path ):
279+ def test_provision_fails_with_no_provision_combined (
280+ cmd , initproj , minversion_option , next_tox_major , json_path
281+ ):
261282 p = initproj (
262283 "test-0.1" ,
263284 {
264285 "tox.ini" : """\
265286 [tox]
266- minversion = {}
287+ {} = {}
267288 requires =
268289 setuptools > 2
269290 pip > 3
270291 """ .format (
292+ minversion_option ,
271293 next_tox_major ,
272294 )
273295 },
@@ -389,15 +411,16 @@ def space_path2url(path):
389411 return urljoin ("file:" , pathname2url (os .path .abspath (at_path )))
390412
391413
392- def test_provision_does_not_occur_in_devenv (newconfig , next_tox_major ):
414+ def test_provision_does_not_occur_in_devenv (newconfig , minversion_option , next_tox_major ):
393415 """Adding --devenv should not change the directory where provisioning occurs"""
394416 with pytest .raises (MissingRequirement ) as context :
395417 newconfig (
396418 ["--devenv" , "my_devenv" ],
397419 """\
398420 [tox]
399- minversion = {}
421+ {} = {}
400422 """ .format (
423+ minversion_option ,
401424 next_tox_major ,
402425 ),
403426 )
0 commit comments