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

Method test_python315_version_detection

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

Source from the content-addressed store, hash-verified

266 self.assertIn(black.Feature.TYPE_PARAM_DEFAULTS, features)
267
268 def test_python315_version_detection(self) -> None:
269 source, _ = read_data("cases", "python315")
270 root = black.lib2to3_parse(source)
271 features = black.get_features_used(root)
272 self.assertIn(black.Feature.LAZY_IMPORTS, features)
273 self.assertIn(black.Feature.UNPACKING_IN_COMPREHENSIONS, features)
274 self.assertNotIn(
275 black.Feature.LAZY_IMPORTS,
276 black.get_features_used(black.lib2to3_parse("lazy = 1\n")),
277 )
278 versions = black.detect_target_versions(root)
279 self.assertIn(black.TargetVersion.PY315, versions)
280
281 def test_expression_ff(self) -> None:
282 source, expected = read_data("cases", "expression.py")

Callers

nothing calls this directly

Calls 1

read_dataFunction · 0.90

Tested by

no test coverage detected