isidentical / teyit

Formatter for your Python unit tests
MIT License
104 stars 7 forks source link

Formatting is not preserved #7

Closed jugmac00 closed 2 years ago

jugmac00 commented 2 years ago
-        self.assertTrue(
-            "Rejected:\n"
-            "Launchpad failed to process the upload path '~name16/ubuntu':\n\n"
-            "unicode PPA name: áří is disabled.\n\n"
-            "It is likely that you have a configuration problem with "
-            "dput/dupload.\n"
-            "Please check the documentation at "
-            "https://help.launchpad.net/Packaging/PPA/Uploading and update "
-            "your configuration.\n\n"
-            "Further error processing not possible because of a critical "
-            "previous error." in body)
+        self.assertIn(
+            "Rejected:\nLaunchpad failed to process the upload path '~name16/ubuntu':\n\nunicode PPA name: áří is disabled.\n\nIt is likely that you have a configuration problem with dput/dupload.\nPlease check the documentation at https://help.launchpad.net/Packaging/PPA/Uploading and update your configuration.\n\nFurther error processing not possible because of a critical previous error.",
+            body
+        )

Using pre-commit, applying black after teyit would probably fix this, though.

isidentical commented 2 years ago

Thanks for the report @jugmac00. We have an internal sanity check that ensures that the retrieved part of the call argument (in this case the long string) is a valid python code as is, but seems like that was broken for indented multi-line expressions such as implicit string concatenation. I've now fixed it at the refactor, isidentical/refactor#19. And will bump the bundled refactor version at teyit.