(self)
| 769 | self.assertEqual(f"{-0.:🖤>z6.1f}", "🖤🖤🖤0.0") # multi-byte fill char |
| 770 | |
| 771 | def test_specifier_z_error(self): |
| 772 | error_msg = re.compile("Invalid format specifier '.*z.*'") |
| 773 | with self.assertRaisesRegex(ValueError, error_msg): |
| 774 | f"{0:z+f}" # wrong position |
| 775 | with self.assertRaisesRegex(ValueError, error_msg): |
| 776 | f"{0:fz}" # wrong position |
| 777 | |
| 778 | error_msg = re.escape("Negative zero coercion (z) not allowed") |
| 779 | with self.assertRaisesRegex(ValueError, error_msg): |
| 780 | f"{0:zd}" # can't apply to int presentation type |
| 781 | with self.assertRaisesRegex(ValueError, error_msg): |
| 782 | f"{'x':zs}" # can't apply to string |
| 783 | |
| 784 | error_msg = re.escape("unsupported format %z at position 0") |
| 785 | with self.assertRaisesRegex(ValueError, error_msg): |
| 786 | "%z.1f" % 0 # not allowed in old style string interpolation |
| 787 | with self.assertRaisesRegex(ValueError, error_msg): |
| 788 | b"%z.1f" % 0 |
| 789 | |
| 790 | |
| 791 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected