| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1703,8 +1703,6 @@ def test_inconsistent_converters_state(self): | |||
| 1703 | 1703 | class ExceptionPicklingTestCase(unittest.TestCase): | |
| 1704 | 1704 | """Tests for issue #13760: ConfigParser exceptions are not picklable.""" | |
| 1705 | 1705 | ||
| 1706 | - # TODO: RUSTPYTHON Exception.__reduce__ missing. | ||
| 1707 | - @unittest.expectedFailure | ||
| 1708 | 1706 | def test_error(self): | |
| 1709 | 1707 | import pickle | |
| 1710 | 1708 | e1 = configparser.Error('value') | |
@@ -1714,8 +1712,6 @@ def test_error(self): | |||
| 1714 | 1712 | self.assertEqual(e1.message, e2.message) | |
| 1715 | 1713 | self.assertEqual(repr(e1), repr(e2)) | |
| 1716 | 1714 | ||
| 1717 | - # TODO: RUSTPYTHON | ||
| 1718 | - @unittest.expectedFailure | ||
| 1719 | 1715 | def test_nosectionerror(self): | |
| 1720 | 1716 | import pickle | |
| 1721 | 1717 | e1 = configparser.NoSectionError('section') | |
@@ -1727,8 +1723,6 @@ def test_nosectionerror(self): | |||
| 1727 | 1723 | self.assertEqual(e1.section, e2.section) | |
| 1728 | 1724 | self.assertEqual(repr(e1), repr(e2)) | |
| 1729 | 1725 | ||
| 1730 | - # TODO: RUSTPYTHON | ||
| 1731 | - @unittest.expectedFailure | ||
| 1732 | 1726 | def test_nooptionerror(self): | |
| 1733 | 1727 | import pickle | |
| 1734 | 1728 | e1 = configparser.NoOptionError('option', 'section') | |
@@ -1741,8 +1735,6 @@ def test_nooptionerror(self): | |||
| 1741 | 1735 | self.assertEqual(e1.option, e2.option) | |
| 1742 | 1736 | self.assertEqual(repr(e1), repr(e2)) | |
| 1743 | 1737 | ||
| 1744 | - # TODO: RUSTPYTHON | ||
| 1745 | - @unittest.expectedFailure | ||
| 1746 | 1738 | def test_duplicatesectionerror(self): | |
| 1747 | 1739 | import pickle | |
| 1748 | 1740 | e1 = configparser.DuplicateSectionError('section', 'source', 123) | |
@@ -1756,8 +1748,6 @@ def test_duplicatesectionerror(self): | |||
| 1756 | 1748 | self.assertEqual(e1.lineno, e2.lineno) | |
| 1757 | 1749 | self.assertEqual(repr(e1), repr(e2)) | |
| 1758 | 1750 | ||
| 1759 | - # TODO: RUSTPYTHON | ||
| 1760 | - @unittest.expectedFailure | ||
| 1761 | 1751 | def test_duplicateoptionerror(self): | |
| 1762 | 1752 | import pickle | |
| 1763 | 1753 | e1 = configparser.DuplicateOptionError('section', 'option', 'source', | |
@@ -1773,8 +1763,6 @@ def test_duplicateoptionerror(self): | |||
| 1773 | 1763 | self.assertEqual(e1.lineno, e2.lineno) | |
| 1774 | 1764 | self.assertEqual(repr(e1), repr(e2)) | |
| 1775 | 1765 | ||
| 1776 | - # TODO: RUSTPYTHON | ||
| 1777 | - @unittest.expectedFailure | ||
| 1778 | 1766 | def test_interpolationerror(self): | |
| 1779 | 1767 | import pickle | |
| 1780 | 1768 | e1 = configparser.InterpolationError('option', 'section', 'msg') | |
@@ -1787,8 +1775,6 @@ def test_interpolationerror(self): | |||
| 1787 | 1775 | self.assertEqual(e1.option, e2.option) | |
| 1788 | 1776 | self.assertEqual(repr(e1), repr(e2)) | |
| 1789 | 1777 | ||
| 1790 | - # TODO: RUSTPYTHON | ||
| 1791 | - @unittest.expectedFailure | ||
| 1792 | 1778 | def test_interpolationmissingoptionerror(self): | |
| 1793 | 1779 | import pickle | |
| 1794 | 1780 | e1 = configparser.InterpolationMissingOptionError('option', 'section', | |
@@ -1803,8 +1789,6 @@ def test_interpolationmissingoptionerror(self): | |||
| 1803 | 1789 | self.assertEqual(e1.reference, e2.reference) | |
| 1804 | 1790 | self.assertEqual(repr(e1), repr(e2)) | |
| 1805 | 1791 | ||
| 1806 | - # TODO: RUSTPYTHON | ||
| 1807 | - @unittest.expectedFailure | ||
| 1808 | 1792 | def test_interpolationsyntaxerror(self): | |
| 1809 | 1793 | import pickle | |
| 1810 | 1794 | e1 = configparser.InterpolationSyntaxError('option', 'section', 'msg') | |
@@ -1817,8 +1801,6 @@ def test_interpolationsyntaxerror(self): | |||
| 1817 | 1801 | self.assertEqual(e1.option, e2.option) | |
| 1818 | 1802 | self.assertEqual(repr(e1), repr(e2)) | |
| 1819 | 1803 | ||
| 1820 | - # TODO: RUSTPYTHON | ||
| 1821 | - @unittest.expectedFailure | ||
| 1822 | 1804 | def test_interpolationdeptherror(self): | |
| 1823 | 1805 | import pickle | |
| 1824 | 1806 | e1 = configparser.InterpolationDepthError('option', 'section', | |
@@ -1832,8 +1814,6 @@ def test_interpolationdeptherror(self): | |||
| 1832 | 1814 | self.assertEqual(e1.option, e2.option) | |
| 1833 | 1815 | self.assertEqual(repr(e1), repr(e2)) | |
| 1834 | 1816 | ||
| 1835 | - # TODO: RUSTPYTHON | ||
| 1836 | - @unittest.expectedFailure | ||
| 1837 | 1817 | def test_parsingerror(self): | |
| 1838 | 1818 | import pickle | |
| 1839 | 1819 | e1 = configparser.ParsingError('source') | |
@@ -1861,8 +1841,6 @@ def test_parsingerror(self): | |||
| 1861 | 1841 | self.assertEqual(e1.errors, e2.errors) | |
| 1862 | 1842 | self.assertEqual(repr(e1), repr(e2)) | |
| 1863 | 1843 | ||
| 1864 | - # TODO: RUSTPYTHON | ||
| 1865 | - @unittest.expectedFailure | ||
| 1866 | 1844 | def test_missingsectionheadererror(self): | |
| 1867 | 1845 | import pickle | |
| 1868 | 1846 | e1 = configparser.MissingSectionHeaderError('filename', 123, 'line') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1923,8 +1923,6 @@ def test_non_str_argument(self): | |||
| 1923 | 1923 | exc = ImportError(arg) | |
| 1924 | 1924 | self.assertEqual(str(arg), str(exc)) | |
| 1925 | 1925 | ||
| 1926 | - # TODO: RUSTPYTHON | ||
| 1927 | - @unittest.expectedFailure | ||
| 1928 | 1926 | def test_copy_pickle(self): | |
| 1929 | 1927 | for kwargs in (dict(), | |
| 1930 | 1928 | dict(name='somename'), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -499,8 +499,6 @@ def test_discover_with_modules_that_fail_to_import(self): | |||
| 499 | 499 | with self.assertRaises(ImportError): | |
| 500 | 500 | test.test_this_does_not_exist() | |
| 501 | 501 | ||
| 502 | - # TODO: RUSTPYTHON ImportError.__reduce__ missing | ||
| 503 | - @unittest.expectedFailure | ||
| 504 | 502 | def test_discover_with_init_modules_that_fail_to_import(self): | |
| 505 | 503 | vfs = {abspath('/foo'): ['my_package'], | |
| 506 | 504 | abspath('/foo/my_package'): ['__init__.py', 'test_module.py']} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -519,6 +519,15 @@ impl PyBaseException { | |||
| 519 | 519 | let cls = zelf.class(); | |
| 520 | 520 | format!("{}({})", cls.name(), repr_args.iter().format(", ")) | |
| 521 | 521 | } | |
| 522 | + | ||
| 523 | + #[pymethod(magic)] | ||
| 524 | + fn reduce(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyTupleRef { | ||
| 525 | + if let Some(dict) = zelf.as_object().dict().filter(|x| !x.is_empty()) { | ||
| 526 | + return vm.new_tuple((zelf.class().clone(), zelf.args(), dict)); | ||
| 527 | + } else { | ||
| 528 | + return vm.new_tuple((zelf.class().clone(), zelf.args())); | ||
| 529 | + } | ||
| 530 | + } | ||
| 522 | 531 | } | |
| 523 | 532 | ||
| 524 | 533 | impl ExceptionZoo { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments