7
7
msgstr ""
8
8
"Project-Id-Version : Python 3.11\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
- "POT-Creation-Date : 2022-10-15 20:43 +0000\n "
10
+ "POT-Creation-Date : 2023-04-03 00:16 +0000\n "
11
11
"PO-Revision-Date : 2018-05-23 16:12+0000\n "
12
12
"Last-Translator : Adrian Liaw <adrianliaw2000@gmail.com>\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -671,9 +671,9 @@ msgstr ""
671
671
672
672
#: ../../library/test.rst:624
673
673
msgid ""
674
- "Print a warning into :data:`sys.__stderr__`. Format the message as: ``f "
675
- "\" Warning -- {msg}\" ``. If *msg* is made of multiple lines, add `` \" Warning "
676
- "-- \" `` prefix to each line."
674
+ "Print a warning into :data:`sys.__stderr__`. Format the message as: "
675
+ "``f \" Warning -- {msg}\" ``. If *msg* is made of multiple lines, add "
676
+ "`` \" Warning -- \" `` prefix to each line."
677
677
msgstr ""
678
678
679
679
#: ../../library/test.rst:633
@@ -1674,12 +1674,20 @@ msgstr ""
1674
1674
1675
1675
#: ../../library/test.rst:1636
1676
1676
msgid ""
1677
+ "Suppress warnings that are instances of *category*, which must be :exc:"
1678
+ "`Warning` or a subclass. Roughly equivalent to :func:`warnings."
1679
+ "catch_warnings` with :meth:`warnings.simplefilter('ignore', "
1680
+ "category=category) <warnings.simplefilter>`. For example::"
1681
+ msgstr ""
1682
+
1683
+ #: ../../library/test.rst:1651
1684
+ msgid ""
1677
1685
"Context manager to check that no :exc:`ResourceWarning` was raised. You "
1678
1686
"must remove the object which may emit :exc:`ResourceWarning` before the end "
1679
1687
"of the context manager."
1680
1688
msgstr ""
1681
1689
1682
- #: ../../library/test.rst:1643
1690
+ #: ../../library/test.rst:1658
1683
1691
msgid ""
1684
1692
"Test for syntax warning in *statement* by attempting to compile *statement*. "
1685
1693
"Test also that the :exc:`SyntaxWarning` is emitted only once, and that it "
@@ -1691,7 +1699,7 @@ msgid ""
1691
1699
"``None``, compares to the offset of the exception."
1692
1700
msgstr ""
1693
1701
1694
- #: ../../library/test.rst:1657
1702
+ #: ../../library/test.rst:1672
1695
1703
msgid ""
1696
1704
"A convenience wrapper for :func:`warnings.catch_warnings()` that makes it "
1697
1705
"easier to test that a warning was correctly raised. It is approximately "
@@ -1700,7 +1708,7 @@ msgid ""
1700
1708
"automatically validate the results that are recorded."
1701
1709
msgstr ""
1702
1710
1703
- #: ../../library/test.rst:1663
1711
+ #: ../../library/test.rst:1678
1704
1712
msgid ""
1705
1713
"``check_warnings`` accepts 2-tuples of the form ``(\" message regexp\" , "
1706
1714
"WarningCategory)`` as positional arguments. If one or more *filters* are "
@@ -1712,15 +1720,15 @@ msgid ""
1712
1720
"*quiet* to ``True``."
1713
1721
msgstr ""
1714
1722
1715
- #: ../../library/test.rst:1672
1723
+ #: ../../library/test.rst:1687
1716
1724
msgid "If no arguments are specified, it defaults to::"
1717
1725
msgstr ""
1718
1726
1719
- #: ../../library/test.rst:1676
1727
+ #: ../../library/test.rst:1691
1720
1728
msgid "In this case all warnings are caught and no errors are raised."
1721
1729
msgstr ""
1722
1730
1723
- #: ../../library/test.rst:1678
1731
+ #: ../../library/test.rst:1693
1724
1732
msgid ""
1725
1733
"On entry to the context manager, a :class:`WarningRecorder` instance is "
1726
1734
"returned. The underlying warnings list from :func:`~warnings.catch_warnings` "
@@ -1732,39 +1740,39 @@ msgid ""
1732
1740
"return ``None``."
1733
1741
msgstr ""
1734
1742
1735
- #: ../../library/test.rst:1687
1743
+ #: ../../library/test.rst:1702
1736
1744
msgid ""
1737
1745
"The recorder object also has a :meth:`reset` method, which clears the "
1738
1746
"warnings list."
1739
1747
msgstr ""
1740
1748
1741
- #: ../../library/test.rst:1690
1749
+ #: ../../library/test.rst:1705
1742
1750
msgid "The context manager is designed to be used like this::"
1743
1751
msgstr ""
1744
1752
1745
- #: ../../library/test.rst:1697
1753
+ #: ../../library/test.rst:1712
1746
1754
msgid ""
1747
1755
"In this case if either warning was not raised, or some other warning was "
1748
1756
"raised, :func:`check_warnings` would raise an error."
1749
1757
msgstr ""
1750
1758
1751
- #: ../../library/test.rst:1700
1759
+ #: ../../library/test.rst:1715
1752
1760
msgid ""
1753
1761
"When a test needs to look more deeply into the warnings, rather than just "
1754
1762
"checking whether or not they occurred, code like this can be used::"
1755
1763
msgstr ""
1756
1764
1757
- #: ../../library/test.rst:1714
1765
+ #: ../../library/test.rst:1729
1758
1766
msgid ""
1759
1767
"Here all warnings will be caught, and the test code tests the captured "
1760
1768
"warnings directly."
1761
1769
msgstr ""
1762
1770
1763
- #: ../../library/test.rst:1717
1771
+ #: ../../library/test.rst:1732
1764
1772
msgid "New optional arguments *filters* and *quiet*."
1765
1773
msgstr ""
1766
1774
1767
- #: ../../library/test.rst:1723
1775
+ #: ../../library/test.rst:1738
1768
1776
msgid ""
1769
1777
"Class used to record warnings for unit tests. See documentation of :func:"
1770
1778
"`check_warnings` above for more details."
0 commit comments