]> 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:

Fix print() function on Python 2 (#754)
[etc/vim.git] / tests / test_black.py
index 7c99f00906b31d3054ff8493911011e2f6b17954..645eec7ae787afd7e66797bdcec65ae8cd4c91c7 100644 (file)
@@ -461,6 +461,14 @@ class BlackTestCase(unittest.TestCase):
         # black.assert_equivalent(source, actual)
         black.assert_stable(source, actual, black.FileMode())
 
+    @patch("black.dump_to_file", dump_to_stderr)
+    def test_python2_print_function(self) -> None:
+        source, expected = read_data("python2_print_function")
+        mode = black.FileMode(target_versions={black.TargetVersion.PY27})
+        actual = fs(source, mode=mode)
+        self.assertFormatEqual(expected, actual)
+        black.assert_stable(source, actual, mode)
+
     @patch("black.dump_to_file", dump_to_stderr)
     def test_python2_unicode_literals(self) -> None:
         source, expected = read_data("python2_unicode_literals")