MCPcopy
hub / github.com/psf/black / test_pep_696_version_detection

Method test_pep_696_version_detection

tests/test_black.py:253–266  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

251 self.assertIn(black.TargetVersion.PY312, versions)
252
253 def test_pep_696_version_detection(self) -> None:
254 source, _ = read_data("cases", "type_param_defaults")
255 samples = [
256 source,
257 "type X[T=int] = float",
258 "type X[T:int=int]=int",
259 "type X[*Ts=int]=int",
260 "type X[*Ts=*int]=int",
261 "type X[**P=int]=int",
262 ]
263 for sample in samples:
264 root = black.lib2to3_parse(sample)
265 features = black.get_features_used(root)
266 self.assertIn(black.Feature.TYPE_PARAM_DEFAULTS, features)
267
268 def test_python315_version_detection(self) -> None:
269 source, _ = read_data("cases", "python315")

Callers

nothing calls this directly

Calls 1

read_dataFunction · 0.90

Tested by

no test coverage detected