@@ -110,24 +110,44 @@ def test_dump_version_modern(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) ->
110110 assert target .read_text () == version
111111
112112
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 :
117114 from setuptools_scm ._integration .dump_version import write_version_to_path
118115
119116 version = "1.2.3"
120117 scm_version = meta (version , config = c )
121118 write_version_to_path (
122119 tmp_path / "VERSION.py" , template = None , version = version , scm_version = scm_version
123120 )
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 )
124128 subprocess .run (
125129 [python37 , "-c" , "import VERSION;print(VERSION.version)" ],
126130 cwd = tmp_path ,
127131 check = True ,
128132 )
129133
130134
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+
131151def test_has_command () -> None :
132152 with pytest .warns (RuntimeWarning , match = "yadayada" ):
133153 assert not has_command ("yadayada_setuptools_aint_ne" )
0 commit comments