(self)
| 621 | |
| 622 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 623 | def test_specifier_z_error(self): |
| 624 | error_msg = re.compile("Invalid format specifier '.*z.*'") |
| 625 | with self.assertRaisesRegex(ValueError, error_msg): |
| 626 | f"{0:z+f}" # wrong position |
| 627 | with self.assertRaisesRegex(ValueError, error_msg): |
| 628 | f"{0:fz}" # wrong position |
| 629 | |
| 630 | error_msg = re.escape("Negative zero coercion (z) not allowed") |
| 631 | with self.assertRaisesRegex(ValueError, error_msg): |
| 632 | f"{0:zd}" # can't apply to int presentation type |
| 633 | with self.assertRaisesRegex(ValueError, error_msg): |
| 634 | f"{'x':zs}" # can't apply to string |
| 635 | |
| 636 | error_msg = re.escape("unsupported format character 'z'") |
| 637 | with self.assertRaisesRegex(ValueError, error_msg): |
| 638 | "%z.1f" % 0 # not allowed in old style string interpolation |
| 639 | with self.assertRaisesRegex(ValueError, error_msg): |
| 640 | b"%z.1f" % 0 |
| 641 | |
| 642 | |
| 643 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected