]> git.madduck.net Git - etc/vim.git/blobdiff - tests/test_black.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Imply 3.8+ when annotated assigments used with unparenthesized tuples (#2708)
[etc/vim.git] / tests / test_black.py
index 8726cc10ddcf13a9c648f32225c32f0bc246fc63..628647ed9774d18a007e7d0d50538c98f6a715a8 100644 (file)
@@ -818,6 +818,18 @@ class BlackTestCase(BlackBaseTestCase):
         self.assertEqual(black.get_features_used(node), {Feature.UNPACKING_ON_FLOW})
         node = black.lib2to3_parse("def fn(): return a, *b, c")
         self.assertEqual(black.get_features_used(node), {Feature.UNPACKING_ON_FLOW})
         self.assertEqual(black.get_features_used(node), {Feature.UNPACKING_ON_FLOW})
         node = black.lib2to3_parse("def fn(): return a, *b, c")
         self.assertEqual(black.get_features_used(node), {Feature.UNPACKING_ON_FLOW})
+        node = black.lib2to3_parse("x = a, *b, c")
+        self.assertEqual(black.get_features_used(node), set())
+        node = black.lib2to3_parse("x: Any = regular")
+        self.assertEqual(black.get_features_used(node), set())
+        node = black.lib2to3_parse("x: Any = (regular, regular)")
+        self.assertEqual(black.get_features_used(node), set())
+        node = black.lib2to3_parse("x: Any = Complex(Type(1))[something]")
+        self.assertEqual(black.get_features_used(node), set())
+        node = black.lib2to3_parse("x: Tuple[int, ...] = a, b, c")
+        self.assertEqual(
+            black.get_features_used(node), {Feature.ANN_ASSIGN_EXTENDED_RHS}
+        )
 
     def test_get_features_used_for_future_flags(self) -> None:
         for src, features in [
 
     def test_get_features_used_for_future_flags(self) -> None:
         for src, features in [