@@ -110,24 +110,44 @@ def test_dump_version_modern(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) ->
110
110
assert target .read_text () == version
111
111
112
112
113
- def test_dump_version_on_old_python (tmp_path : Path ) -> None :
114
- python37 = shutil .which ("python3.7" )
115
- if python37 is None :
116
- pytest .skip ("python3.7 not found" )
113
+ def dump_a_version (tmp_path : Path ) -> None :
117
114
from setuptools_scm ._integration .dump_version import write_version_to_path
118
115
119
116
version = "1.2.3"
120
117
scm_version = meta (version , config = c )
121
118
write_version_to_path (
122
119
tmp_path / "VERSION.py" , template = None , version = version , scm_version = scm_version
123
120
)
121
+
122
+
123
+ def test_dump_version_on_old_python (tmp_path : Path ) -> None :
124
+ python37 = shutil .which ("python3.7" )
125
+ if python37 is None :
126
+ pytest .skip ("python3.7 not found" )
127
+ dump_a_version (tmp_path )
124
128
subprocess .run (
125
129
[python37 , "-c" , "import VERSION;print(VERSION.version)" ],
126
130
cwd = tmp_path ,
127
131
check = True ,
128
132
)
129
133
130
134
135
+ def test_dump_version_mypy (tmp_path : Path ) -> None :
136
+ mypy = shutil .which ("mypy" )
137
+ if mypy is None :
138
+ pytest .skip ("mypy not found" )
139
+ dump_a_version (tmp_path )
140
+ subprocess .run ([mypy , "--strict" , "VERSION.py" ], cwd = tmp_path , check = True )
141
+
142
+
143
+ def test_dump_version_flake8 (tmp_path : Path ) -> None :
144
+ flake8 = shutil .which ("flake8" )
145
+ if flake8 is None :
146
+ pytest .skip ("flake8 not found" )
147
+ dump_a_version (tmp_path )
148
+ subprocess .run ([flake8 , "VERSION.py" ], cwd = tmp_path , check = True )
149
+
150
+
131
151
def test_has_command () -> None :
132
152
with pytest .warns (RuntimeWarning , match = "yadayada" ):
133
153
assert not has_command ("yadayada_setuptools_aint_ne" )
0 commit comments