5
5
import pytest
6
6
7
7
8
+ _PYTHON_VERSION = "." .join (map (str , sys .version_info [:2 ]))
9
+
10
+
8
11
@pytest .mark .end_to_end
9
12
def test_bake_project (cookies ):
10
- major , minor = sys .version_info [:2 ]
11
- python_version = f"{ major } .{ minor } "
12
-
13
13
result = cookies .bake (
14
- extra_context = {"project_slug" : "helloworld" , "python_version" : python_version }
14
+ extra_context = {"project_slug" : "helloworld" , "python_version" : _PYTHON_VERSION }
15
15
)
16
16
17
17
assert result .exit_code == 0
@@ -22,7 +22,12 @@ def test_bake_project(cookies):
22
22
23
23
@pytest .mark .end_to_end
24
24
def test_remove_readthedocs (cookies ):
25
- result = cookies .bake (extra_context = {"add_readthedocs" : "no" })
25
+ result = cookies .bake (
26
+ extra_context = {
27
+ "add_readthedocs" : "no" ,
28
+ "python_version" : "." .join (map (str , sys .version_info [:2 ])),
29
+ }
30
+ )
26
31
27
32
rtd_config = result .project_path .joinpath (".readthedocs.yaml" )
28
33
readme = result .project_path .joinpath ("README.md" ).read_text ()
@@ -36,7 +41,9 @@ def test_remove_readthedocs(cookies):
36
41
37
42
@pytest .mark .end_to_end
38
43
def test_remove_github_actions (cookies ):
39
- result = cookies .bake (extra_context = {"add_github_actions" : "no" })
44
+ result = cookies .bake (
45
+ extra_context = {"add_github_actions" : "no" , "python_version" : _PYTHON_VERSION }
46
+ )
40
47
41
48
ga_config = result .project_path .joinpath (".github" , "workflows" , "main.yml" )
42
49
readme = result .project_path .joinpath ("README.md" ).read_text ()
@@ -50,7 +57,9 @@ def test_remove_github_actions(cookies):
50
57
51
58
@pytest .mark .end_to_end
52
59
def test_remove_tox (cookies ):
53
- result = cookies .bake (extra_context = {"add_tox" : "no" })
60
+ result = cookies .bake (
61
+ extra_context = {"add_tox" : "no" , "python_version" : _PYTHON_VERSION }
62
+ )
54
63
55
64
ga_config = result .project_path .joinpath (".github" , "workflows" , "main.yml" )
56
65
tox = result .project_path .joinpath ("tox.ini" )
@@ -64,7 +73,12 @@ def test_remove_tox(cookies):
64
73
65
74
@pytest .mark .end_to_end
66
75
def test_remove_license (cookies ):
67
- result = cookies .bake (extra_context = {"open_source_license" : "Not open source" })
76
+ result = cookies .bake (
77
+ extra_context = {
78
+ "open_source_license" : "Not open source" ,
79
+ "python_version" : _PYTHON_VERSION ,
80
+ }
81
+ )
68
82
69
83
license_ = result .project_path .joinpath ("LICENSE" )
70
84
@@ -83,6 +97,7 @@ def test_check_conda_environment_creation_and_run_all_checks(cookies):
83
97
"conda_environment_name" : "__test__" ,
84
98
"make_initial_commit" : "yes" ,
85
99
"create_conda_environment_at_finish" : "yes" ,
100
+ "python_version" : _PYTHON_VERSION ,
86
101
}
87
102
)
88
103
0 commit comments