chunk_id
stringlengths
36
36
source
stringclasses
35 values
source_url
stringlengths
0
290
upstream_license
stringclasses
1 value
document_id
stringlengths
36
36
chunk_index
int64
0
324k
retrieved_at
stringclasses
2 values
chunker_version
stringclasses
4 values
content_hash
stringlengths
15
64
content
stringlengths
50
44.7k
namespace
stringclasses
9 values
source_name
stringclasses
35 values
raw_text
stringlengths
50
44.7k
cleaned_text
stringlengths
50
44.7k
tags
stringclasses
49 values
collection_name
stringclasses
11 values
4c07a353-62e7-4be7-a37f-20eca26b31b8
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,516
supabase-export-v2
f53e104fb112daee
The unittest module can be used from the command line to run tests from modules, classes or even individual test methods:: python -m unittest test_module1 test_module2 python -m unittest test_module.TestClass python -m unittest test_module.TestClass.test_method
trusted_official_docs
CPython Docs
The unittest module can be used from the command line to run tests from modules, classes or even individual test methods:: python -m unittest test_module1 test_module2 python -m unittest test_module.TestClass python -m unittest test_module.TestClass.test_method
The unittest module can be used from the command line to run tests from modules, classes or even individual test methods:: python -m unittest test_module1 test_module2 python -m unittest test_module.TestClass python -m unittest test_module.TestClass.test_method
python, official-docs, cpython, P0
Local_Trusted_Corpus
4cd4a5ea-5503-4b08-84f0-800b23b31c65
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,136
supabase-export-v2
6e4a65af6fd1eb4d
into ``load_tests`` the package is free to continue (and potentially modify) test discovery. A 'do nothing' ``load_tests`` function for a test package would look like:: def load_tests(loader, standard_tests, pattern): # top level directory cached on loader instance this_dir = os.path.dirname(__file__) package_tests ...
trusted_official_docs
CPython Docs
into ``load_tests`` the package is free to continue (and potentially modify) test discovery. A 'do nothing' ``load_tests`` function for a test package would look like:: def load_tests(loader, standard_tests, pattern): # top level directory cached on loader instance this_dir = os.path.dirname(__file__) package_tests ...
into ``load_tests`` the package is free to continue (and potentially modify) test discovery. A 'do nothing' ``load_tests`` function for a test package would look like:: def load_tests(loader, standard_tests, pattern): # top level directory cached on loader instance this_dir = os.path.dirname(__file__) package_tests ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4d8ff391-d3fe-4be2-98d8-71edfec86035
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,698
supabase-export-v2
1904844e84e95e29
is omitted or ``None``, a temporary result object is created (by calling the :meth:`defaultTestResult` method) and used. The result object is returned to :meth:`run`'s caller. The same effect may be had by simply calling the :class:`TestCase` instance.
trusted_official_docs
CPython Docs
is omitted or ``None``, a temporary result object is created (by calling the :meth:`defaultTestResult` method) and used. The result object is returned to :meth:`run`'s caller. The same effect may be had by simply calling the :class:`TestCase` instance.
is omitted or ``None``, a temporary result object is created (by calling the :meth:`defaultTestResult` method) and used. The result object is returned to :meth:`run`'s caller. The same effect may be had by simply calling the :class:`TestCase` instance.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4dad7c69-ccc9-4ee9-a0b0-9b6da716adb6
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,976
supabase-export-v2
345dc519f47d0f13
Return a suite of all test cases given a string specifier. The specifier *name* is a "dotted name" that may resolve either to a module, a test case class, a test method within a test case class, a :class:`TestSuite` instance, or a callable object which returns a :class:`TestCase` or :class:`TestSuite` instance. Thes...
trusted_official_docs
CPython Docs
Return a suite of all test cases given a string specifier. The specifier *name* is a "dotted name" that may resolve either to a module, a test case class, a test method within a test case class, a :class:`TestSuite` instance, or a callable object which returns a :class:`TestCase` or :class:`TestSuite` instance. Thes...
Return a suite of all test cases given a string specifier. The specifier *name* is a "dotted name" that may resolve either to a module, a test case class, a test method within a test case class, a :class:`TestSuite` instance, or a callable object which returns a :class:`TestCase` or :class:`TestSuite` instance. Thes...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4df9f938-75af-4448-b1b3-0fe678e972fe
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,966
supabase-export-v2
35d3d8d87e9ba591
names beginning with ``test``. If :meth:`getTestCaseNames` returns no methods, but the :meth:`!runTest` method is implemented, a single test case is created for that method instead. .. method:: loadTestsFromModule(module, *, pattern=None)
trusted_official_docs
CPython Docs
names beginning with ``test``. If :meth:`getTestCaseNames` returns no methods, but the :meth:`!runTest` method is implemented, a single test case is created for that method instead. .. method:: loadTestsFromModule(module, *, pattern=None)
names beginning with ``test``. If :meth:`getTestCaseNames` returns no methods, but the :meth:`!runTest` method is implemented, a single test case is created for that method instead. .. method:: loadTestsFromModule(module, *, pattern=None)
python, official-docs, cpython, P0
Local_Trusted_Corpus
4e86c05c-1547-4fa8-876a-5bcbfcd053d9
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,174
supabase-export-v2
28a181338d7ea660
.. versionadded:: 3.2 The :option:`-c/--catch <unittest -c>` command-line option to unittest, along with the ``catchbreak`` parameter to :func:`unittest.main`, provide more friendly handling of control-C during a test run. With catch break behavior enabled control-C will allow the currently running test to complete, an...
trusted_official_docs
CPython Docs
.. versionadded:: 3.2 The :option:`-c/--catch <unittest -c>` command-line option to unittest, along with the ``catchbreak`` parameter to :func:`unittest.main`, provide more friendly handling of control-C during a test run. With catch break behavior enabled control-C will allow the currently running test to complete, an...
.. versionadded:: 3.2 The :option:`-c/--catch <unittest -c>` command-line option to unittest, along with the ``catchbreak`` parameter to :func:`unittest.main`, provide more friendly handling of control-C during a test run. With catch break behavior enabled control-C will allow the currently running test to complete, an...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4f81fda5-121c-46db-84ee-dfa3210d39f5
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,812
supabase-export-v2
7eeacb74886d4dc1
.. versionchanged:: 3.2 :meth:`assertAlmostEqual` automatically considers almost equal objects that compare equal. :meth:`assertNotAlmostEqual` automatically fails if the objects compare equal. Added the *delta* keyword argument. .. method:: assertGreater(first, second, msg=None) assertGreaterEqual(first, second, msg=...
trusted_official_docs
CPython Docs
.. versionchanged:: 3.2 :meth:`assertAlmostEqual` automatically considers almost equal objects that compare equal. :meth:`assertNotAlmostEqual` automatically fails if the objects compare equal. Added the *delta* keyword argument. .. method:: assertGreater(first, second, msg=None) assertGreaterEqual(first, second, msg=...
.. versionchanged:: 3.2 :meth:`assertAlmostEqual` automatically considers almost equal objects that compare equal. :meth:`assertNotAlmostEqual` automatically fails if the objects compare equal. Added the *delta* keyword argument. .. method:: assertGreater(first, second, msg=None) assertGreaterEqual(first, second, msg=...
python, official-docs, cpython, P0
Local_Trusted_Corpus
50ddf4e4-8049-4168-8abe-3604d2484f53
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,517
supabase-export-v2
ebae9591ffb3ff6f
python -m unittest test_module1 test_module2 python -m unittest test_module.TestClass python -m unittest test_module.TestClass.test_method You can pass in a list with any combination of module names, and fully qualified class or method names.
trusted_official_docs
CPython Docs
python -m unittest test_module1 test_module2 python -m unittest test_module.TestClass python -m unittest test_module.TestClass.test_method You can pass in a list with any combination of module names, and fully qualified class or method names.
python -m unittest test_module1 test_module2 python -m unittest test_module.TestClass python -m unittest test_module.TestClass.test_method You can pass in a list with any combination of module names, and fully qualified class or method names.
python, official-docs, cpython, P0
Local_Trusted_Corpus
514db543-ae13-4114-887d-2701605ee457
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,788
supabase-export-v2
2243540fe0243098
If given, *formatter* should be a :class:`logging.Formatter` object. The default is a formatter with format string ``"%(levelname)s:%(name)s:%(message)s"`` The test passes if at least one message emitted inside the ``with`` block matches the *logger* and *level* conditions, otherwise it fails.
trusted_official_docs
CPython Docs
If given, *formatter* should be a :class:`logging.Formatter` object. The default is a formatter with format string ``"%(levelname)s:%(name)s:%(message)s"`` The test passes if at least one message emitted inside the ``with`` block matches the *logger* and *level* conditions, otherwise it fails.
If given, *formatter* should be a :class:`logging.Formatter` object. The default is a formatter with format string ``"%(levelname)s:%(name)s:%(message)s"`` The test passes if at least one message emitted inside the ``with`` block matches the *logger* and *level* conditions, otherwise it fails.
python, official-docs, cpython, P0
Local_Trusted_Corpus
51c83650-1c63-44c2-ba97-81d1a14cb5c9
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,882
supabase-export-v2
e27c5cd615c685f0
to the order they are added (:abbr:`LIFO (last-in, first-out)`). They are called with any arguments and keyword arguments passed into :meth:`addCleanup` when they are added. If :meth:`setUp` fails, meaning that :meth:`tearDown` is not called, then any cleanup functions added will still be called.
trusted_official_docs
CPython Docs
to the order they are added (:abbr:`LIFO (last-in, first-out)`). They are called with any arguments and keyword arguments passed into :meth:`addCleanup` when they are added. If :meth:`setUp` fails, meaning that :meth:`tearDown` is not called, then any cleanup functions added will still be called.
to the order they are added (:abbr:`LIFO (last-in, first-out)`). They are called with any arguments and keyword arguments passed into :meth:`addCleanup` when they are added. If :meth:`setUp` fails, meaning that :meth:`tearDown` is not called, then any cleanup functions added will still be called.
python, official-docs, cpython, P0
Local_Trusted_Corpus
523bf75a-ee44-42ee-ac75-e2271de5db9f
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,060
supabase-export-v2
ac4046086a6d27ea
Called when the test case *test* raises an unexpected exception. *err* is a tuple of the form returned by :func:`sys.exc_info`: ``(type, value, traceback)``. The default implementation appends a tuple ``(test, formatted_err)`` to the instance's :attr:`errors` attribute, where *formatted_err* is a formatted traceback ...
trusted_official_docs
CPython Docs
Called when the test case *test* raises an unexpected exception. *err* is a tuple of the form returned by :func:`sys.exc_info`: ``(type, value, traceback)``. The default implementation appends a tuple ``(test, formatted_err)`` to the instance's :attr:`errors` attribute, where *formatted_err* is a formatted traceback ...
Called when the test case *test* raises an unexpected exception. *err* is a tuple of the form returned by :func:`sys.exc_info`: ``(type, value, traceback)``. The default implementation appends a tuple ``(test, formatted_err)`` to the instance's :attr:`errors` attribute, where *formatted_err* is a formatted traceback ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5264daac-96ce-44d9-a464-3759e743d666
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,853
supabase-export-v2
8bb73ba6c24ef6d8
.. method:: assertDictEqual(first, second, msg=None) Test that two dictionaries are equal. If not, an error message is constructed that shows the differences in the dictionaries. This method will be used by default to compare dictionaries in calls to :meth:`assertEqual`.
trusted_official_docs
CPython Docs
.. method:: assertDictEqual(first, second, msg=None) Test that two dictionaries are equal. If not, an error message is constructed that shows the differences in the dictionaries. This method will be used by default to compare dictionaries in calls to :meth:`assertEqual`.
.. method:: assertDictEqual(first, second, msg=None) Test that two dictionaries are equal. If not, an error message is constructed that shows the differences in the dictionaries. This method will be used by default to compare dictionaries in calls to :meth:`assertEqual`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
548dc8dc-29e5-49b1-b27a-c817e95c39e8
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,801
supabase-export-v2
30d7ab438b1a831a
should be a :class:`logging.Logger` object or a :class:`str` giving the name of a logger. The default is the root logger, which will catch all messages. If given, *level* should be either a numeric logging level or its string equivalent (for example either ``"ERROR"`` or :const:`logging.ERROR`). The default is :const...
trusted_official_docs
CPython Docs
should be a :class:`logging.Logger` object or a :class:`str` giving the name of a logger. The default is the root logger, which will catch all messages. If given, *level* should be either a numeric logging level or its string equivalent (for example either ``"ERROR"`` or :const:`logging.ERROR`). The default is :const...
should be a :class:`logging.Logger` object or a :class:`str` giving the name of a logger. The default is the root logger, which will catch all messages. If given, *level* should be either a numeric logging level or its string equivalent (for example either ``"ERROR"`` or :const:`logging.ERROR`). The default is :const...
python, official-docs, cpython, P0
Local_Trusted_Corpus
55aa82e1-e49e-42c1-9163-f3d12e38a78f
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,637
supabase-export-v2
f9596d32815db5bb
This is the output of running the example above in verbose mode:: test_format (__main__.MyTestCase.test_format) ... skipped 'not supported in this library version' test_nothing (__main__.MyTestCase.test_nothing) ... skipped 'demonstrating skipping' test_maybe_skipped (__main__.MyTestCase.test_maybe_skipped) ... skipp...
trusted_official_docs
CPython Docs
This is the output of running the example above in verbose mode:: test_format (__main__.MyTestCase.test_format) ... skipped 'not supported in this library version' test_nothing (__main__.MyTestCase.test_nothing) ... skipped 'demonstrating skipping' test_maybe_skipped (__main__.MyTestCase.test_maybe_skipped) ... skipp...
This is the output of running the example above in verbose mode:: test_format (__main__.MyTestCase.test_format) ... skipped 'not supported in this library version' test_nothing (__main__.MyTestCase.test_nothing) ... skipped 'demonstrating skipping' test_maybe_skipped (__main__.MyTestCase.test_maybe_skipped) ... skipp...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5604fd87-3f49-4835-8567-820303c93caf
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,952
supabase-export-v2
eac764d05c623d59
:meth:`TestSuite.run`, callers should not rely on the tests returned by this method unless the caller uses a subclass that overrides :meth:`!TestSuite._removeTestAtIndex` to preserve test references. .. versionchanged:: 3.2 In earlier versions the :class:`TestSuite` accessed tests directly rather than through iterati...
trusted_official_docs
CPython Docs
:meth:`TestSuite.run`, callers should not rely on the tests returned by this method unless the caller uses a subclass that overrides :meth:`!TestSuite._removeTestAtIndex` to preserve test references. .. versionchanged:: 3.2 In earlier versions the :class:`TestSuite` accessed tests directly rather than through iterati...
:meth:`TestSuite.run`, callers should not rely on the tests returned by this method unless the caller uses a subclass that overrides :meth:`!TestSuite._removeTestAtIndex` to preserve test references. .. versionchanged:: 3.2 In earlier versions the :class:`TestSuite` accessed tests directly rather than through iterati...
python, official-docs, cpython, P0
Local_Trusted_Corpus
56f21f9a-43c7-4368-b1fd-1e11cffbed6c
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,158
supabase-export-v2
2d44b50b7abfa8b5
def tearDownModule(): closeConnection() If an exception is raised in a ``setUpModule`` then none of the tests in the module will be run and the ``tearDownModule`` will not be run. If the exception is a :exc:`SkipTest` exception then the module will be reported as having been skipped instead of as an error.
trusted_official_docs
CPython Docs
def tearDownModule(): closeConnection() If an exception is raised in a ``setUpModule`` then none of the tests in the module will be run and the ``tearDownModule`` will not be run. If the exception is a :exc:`SkipTest` exception then the module will be reported as having been skipped instead of as an error.
def tearDownModule(): closeConnection() If an exception is raised in a ``setUpModule`` then none of the tests in the module will be run and the ``tearDownModule`` will not be run. If the exception is a :exc:`SkipTest` exception then the module will be reported as having been skipped instead of as an error.
python, official-docs, cpython, P0
Local_Trusted_Corpus
57239814-d42b-47b7-bf66-090dedb47673
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,772
supabase-export-v2
04e415e7a492383e
.. versionchanged:: 3.3 Added the *msg* keyword argument when used as a context manager. .. versionchanged:: next Warnings that do not match the specified category are no longer swallowed. Nested context managers are now supported.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.3 Added the *msg* keyword argument when used as a context manager. .. versionchanged:: next Warnings that do not match the specified category are no longer swallowed. Nested context managers are now supported.
.. versionchanged:: 3.3 Added the *msg* keyword argument when used as a context manager. .. versionchanged:: next Warnings that do not match the specified category are no longer swallowed. Nested context managers are now supported.
python, official-docs, cpython, P0
Local_Trusted_Corpus
57435726-5d51-4ba2-a140-5213c48d1de9
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,809
supabase-export-v2
9ce6b5bdca76c5b7
to zero. Note that these methods round the values to the given number of *decimal places* (i.e. like the :func:`round` function) and not *significant digits*. If *delta* is supplied instead of *places* then the difference between *first* and *second* must be less or equal to (or greater than) *delta*.
trusted_official_docs
CPython Docs
to zero. Note that these methods round the values to the given number of *decimal places* (i.e. like the :func:`round` function) and not *significant digits*. If *delta* is supplied instead of *places* then the difference between *first* and *second* must be less or equal to (or greater than) *delta*.
to zero. Note that these methods round the values to the given number of *decimal places* (i.e. like the :func:`round` function) and not *significant digits*. If *delta* is supplied instead of *places* then the difference between *first* and *second* must be less or equal to (or greater than) *delta*.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5782b73a-1e62-498b-a49d-bf10a178bf71
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,609
supabase-export-v2
19c23d2a3c0ebb81
* The test code can more easily be separated from shipped code. * There is less temptation to change test code to fit the code it tests without a good reason.
trusted_official_docs
CPython Docs
* The test code can more easily be separated from shipped code. * There is less temptation to change test code to fit the code it tests without a good reason.
* The test code can more easily be separated from shipped code. * There is less temptation to change test code to fit the code it tests without a good reason.
python, official-docs, cpython, P0
Local_Trusted_Corpus
58d759f0-c349-49ca-8535-02a3e3695602
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,832
supabase-export-v2
c80bbdfa2765ccd8
.. _type-specific-methods: The :meth:`assertEqual` method dispatches the equality check for objects of the same type to different type-specific methods. These methods are already implemented for most of the built-in types, but it's also possible to register new methods using :meth:`addTypeEqualityFunc`:
trusted_official_docs
CPython Docs
.. _type-specific-methods: The :meth:`assertEqual` method dispatches the equality check for objects of the same type to different type-specific methods. These methods are already implemented for most of the built-in types, but it's also possible to register new methods using :meth:`addTypeEqualityFunc`:
.. _type-specific-methods: The :meth:`assertEqual` method dispatches the equality check for objects of the same type to different type-specific methods. These methods are already implemented for most of the built-in types, but it's also possible to register new methods using :meth:`addTypeEqualityFunc`:
python, official-docs, cpython, P0
Local_Trusted_Corpus
59876361-f541-4432-b636-bce4d004b9ac
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,478
supabase-export-v2
f04edfb2b5d9ea15
(If you are already familiar with the basic concepts of testing, you might want to skip to :ref:`the list of assert methods <assert-methods>`.) The :mod:`!unittest` unit testing framework was originally inspired by JUnit and has a similar flavor as major unit testing frameworks in other languages. It supports test auto...
trusted_official_docs
CPython Docs
(If you are already familiar with the basic concepts of testing, you might want to skip to :ref:`the list of assert methods <assert-methods>`.) The :mod:`!unittest` unit testing framework was originally inspired by JUnit and has a similar flavor as major unit testing frameworks in other languages. It supports test auto...
(If you are already familiar with the basic concepts of testing, you might want to skip to :ref:`the list of assert methods <assert-methods>`.) The :mod:`!unittest` unit testing framework was originally inspired by JUnit and has a similar flavor as major unit testing frameworks in other languages. It supports test auto...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5a93f271-7bc5-475d-9e49-92ca0ab4f30f
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,575
supabase-export-v2
ffe5050a52df59d5
a different copy of the package then the import *could* happen from the wrong place. If this happens test discovery will warn you and exit. If you supply the start directory as a package name rather than a path to a directory then discover assumes that whichever location it imports from is the location you intended, ...
trusted_official_docs
CPython Docs
a different copy of the package then the import *could* happen from the wrong place. If this happens test discovery will warn you and exit. If you supply the start directory as a package name rather than a path to a directory then discover assumes that whichever location it imports from is the location you intended, ...
a different copy of the package then the import *could* happen from the wrong place. If this happens test discovery will warn you and exit. If you supply the start directory as a package name rather than a path to a directory then discover assumes that whichever location it imports from is the location you intended, ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5b2376c5-4f92-493f-8983-9699c071fe85
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,811
supabase-export-v2
8c649427c12790a3
Supplying both *delta* and *places* raises a :exc:`TypeError`. .. versionchanged:: 3.2 :meth:`assertAlmostEqual` automatically considers almost equal objects that compare equal. :meth:`assertNotAlmostEqual` automatically fails if the objects compare equal. Added the *delta* keyword argument.
trusted_official_docs
CPython Docs
Supplying both *delta* and *places* raises a :exc:`TypeError`. .. versionchanged:: 3.2 :meth:`assertAlmostEqual` automatically considers almost equal objects that compare equal. :meth:`assertNotAlmostEqual` automatically fails if the objects compare equal. Added the *delta* keyword argument.
Supplying both *delta* and *places* raises a :exc:`TypeError`. .. versionchanged:: 3.2 :meth:`assertAlmostEqual` automatically considers almost equal objects that compare equal. :meth:`assertNotAlmostEqual` automatically fails if the objects compare equal. Added the *delta* keyword argument.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5b27fc92-be62-4202-9ad6-d70c1a43df3a
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,953
supabase-export-v2
e2517afa143f8e50
.. versionchanged:: 3.2 In earlier versions the :class:`TestSuite` accessed tests directly rather than through iteration, so overriding :meth:`!__iter__` wasn't sufficient for providing tests. .. versionchanged:: 3.4 In earlier versions the :class:`TestSuite` held references to each :class:`TestCase` after :meth:`Tes...
trusted_official_docs
CPython Docs
.. versionchanged:: 3.2 In earlier versions the :class:`TestSuite` accessed tests directly rather than through iteration, so overriding :meth:`!__iter__` wasn't sufficient for providing tests. .. versionchanged:: 3.4 In earlier versions the :class:`TestSuite` held references to each :class:`TestCase` after :meth:`Tes...
.. versionchanged:: 3.2 In earlier versions the :class:`TestSuite` accessed tests directly rather than through iteration, so overriding :meth:`!__iter__` wasn't sufficient for providing tests. .. versionchanged:: 3.4 In earlier versions the :class:`TestSuite` held references to each :class:`TestCase` after :meth:`Tes...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5b49a0a3-aad1-49b8-a69f-a377a4be7de3
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,585
supabase-export-v2
350dcb94f49dc5af
should be entirely self contained, such that it can be run either in isolation or in arbitrary combination with any number of other test cases. The simplest :class:`TestCase` subclass will simply implement a test method (i.e. a method whose name starts with ``test``) in order to perform specific testing code::
trusted_official_docs
CPython Docs
should be entirely self contained, such that it can be run either in isolation or in arbitrary combination with any number of other test cases. The simplest :class:`TestCase` subclass will simply implement a test method (i.e. a method whose name starts with ``test``) in order to perform specific testing code::
should be entirely self contained, such that it can be run either in isolation or in arbitrary combination with any number of other test cases. The simplest :class:`TestCase` subclass will simply implement a test method (i.e. a method whose name starts with ``test``) in order to perform specific testing code::
python, official-docs, cpython, P0
Local_Trusted_Corpus
5b5a1d80-42f4-4a99-b1d5-a4ba775520a7
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,742
supabase-export-v2
9694a92abd688890
fails if no exception is raised. To catch any of a group of exceptions, a tuple containing the exception classes may be passed as *exception*. If only the *exception* and possibly the *msg* arguments are given, return a context manager so that the code under test can be written inline rather than as a function::
trusted_official_docs
CPython Docs
fails if no exception is raised. To catch any of a group of exceptions, a tuple containing the exception classes may be passed as *exception*. If only the *exception* and possibly the *msg* arguments are given, return a context manager so that the code under test can be written inline rather than as a function::
fails if no exception is raised. To catch any of a group of exceptions, a tuple containing the exception classes may be passed as *exception*. If only the *exception* and possibly the *msg* arguments are given, return a context manager so that the code under test can be written inline rather than as a function::
python, official-docs, cpython, P0
Local_Trusted_Corpus
5c8e6e78-1ddf-4064-b096-0f51011910c4
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,671
supabase-export-v2
939a19fa946ed9a9
5 are all even. ---------------------------------------------------------------------- Traceback (most recent call last): File "subtests.py", line 11, in test_even self.assertEqual(i % 2, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 1 != 0 Without using a subtest, execution would stop after the first failure, and the ...
trusted_official_docs
CPython Docs
5 are all even. ---------------------------------------------------------------------- Traceback (most recent call last): File "subtests.py", line 11, in test_even self.assertEqual(i % 2, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 1 != 0 Without using a subtest, execution would stop after the first failure, and the ...
5 are all even. ---------------------------------------------------------------------- Traceback (most recent call last): File "subtests.py", line 11, in test_even self.assertEqual(i % 2, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 1 != 0 Without using a subtest, execution would stop after the first failure, and the ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5d7db2cf-88ed-42cb-bd4b-a6bcaf183569
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,109
supabase-export-v2
c63205af661ff298
names are specified via *argv*. If not specified or ``None`` and no test names are provided via *argv*, all tests found in *module* are run. The *argv* argument can be a list of options passed to the program, with the first element being the program name. If not specified or ``None``, the values of :data:`sys.argv` a...
trusted_official_docs
CPython Docs
names are specified via *argv*. If not specified or ``None`` and no test names are provided via *argv*, all tests found in *module* are run. The *argv* argument can be a list of options passed to the program, with the first element being the program name. If not specified or ``None``, the values of :data:`sys.argv` a...
names are specified via *argv*. If not specified or ``None`` and no test names are provided via *argv*, all tests found in *module* are run. The *argv* argument can be a list of options passed to the program, with the first element being the program name. If not specified or ``None``, the values of :data:`sys.argv` a...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5dc189e8-5d6e-4385-b671-a9510ee2169e
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,991
supabase-export-v2
411c42dd5ee82be9
The pattern is deliberately not stored as a loader attribute so that packages can continue discovery themselves. *top_level_dir* is stored internally, and used as a default to any nested calls to ``discover()``. That is, if a package's ``load_tests`` calls ``loader.discover()``, it does not need to pass this argument...
trusted_official_docs
CPython Docs
The pattern is deliberately not stored as a loader attribute so that packages can continue discovery themselves. *top_level_dir* is stored internally, and used as a default to any nested calls to ``discover()``. That is, if a package's ``load_tests`` calls ``loader.discover()``, it does not need to pass this argument...
The pattern is deliberately not stored as a loader attribute so that packages can continue discovery themselves. *top_level_dir* is stored internally, and used as a default to any nested calls to ``discover()``. That is, if a package's ``load_tests`` calls ``loader.discover()``, it does not need to pass this argument...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5e665817-d15d-44da-8066-17b05112a619
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,623
supabase-export-v2
7d7a80cea82bbac3
.. note:: Even though :class:`FunctionTestCase` can be used to quickly convert an existing test base over to a :mod:`!unittest`\ -based system, this approach is not recommended. Taking the time to set up proper :class:`TestCase` subclasses will make future test refactorings infinitely easier.
trusted_official_docs
CPython Docs
.. note:: Even though :class:`FunctionTestCase` can be used to quickly convert an existing test base over to a :mod:`!unittest`\ -based system, this approach is not recommended. Taking the time to set up proper :class:`TestCase` subclasses will make future test refactorings infinitely easier.
.. note:: Even though :class:`FunctionTestCase` can be used to quickly convert an existing test base over to a :mod:`!unittest`\ -based system, this approach is not recommended. Taking the time to set up proper :class:`TestCase` subclasses will make future test refactorings infinitely easier.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5e6764ef-41e9-48a4-91ee-705b4a3b68b0
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,072
supabase-export-v2
b8e6ed9155ec9d7b
Called when the test case *test* fails or errors, but was marked with the :func:`expectedFailure` decorator. The default implementation appends a tuple ``(test, formatted_err)`` to the instance's :attr:`expectedFailures` attribute, where *formatted_err* is a formatted traceback derived from *err*.
trusted_official_docs
CPython Docs
Called when the test case *test* fails or errors, but was marked with the :func:`expectedFailure` decorator. The default implementation appends a tuple ``(test, formatted_err)`` to the instance's :attr:`expectedFailures` attribute, where *formatted_err* is a formatted traceback derived from *err*.
Called when the test case *test* fails or errors, but was marked with the :func:`expectedFailure` decorator. The default implementation appends a tuple ``(test, formatted_err)`` to the instance's :attr:`expectedFailures` attribute, where *formatted_err* is a formatted traceback derived from *err*.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5ebaa9cf-396e-4e2d-8e81-833147bd4285
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,511
supabase-export-v2
f5a3250b21d368fa
OK The above examples show the most commonly used :mod:`!unittest` features which are sufficient to meet many everyday testing needs. The remainder of the documentation explores the full feature set from first principles.
trusted_official_docs
CPython Docs
OK The above examples show the most commonly used :mod:`!unittest` features which are sufficient to meet many everyday testing needs. The remainder of the documentation explores the full feature set from first principles.
OK The above examples show the most commonly used :mod:`!unittest` features which are sufficient to meet many everyday testing needs. The remainder of the documentation explores the full feature set from first principles.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5f4a6584-5a46-48cd-85aa-ae28f41f5efc
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,541
supabase-export-v2
a392f33f1f2ea6bf
Patterns that contain a wildcard character (``*``) are matched against the test name using :meth:`fnmatch.fnmatchcase`; otherwise simple case-sensitive substring matching is used. Patterns are matched against the fully qualified test method name as imported by the test loader.
trusted_official_docs
CPython Docs
Patterns that contain a wildcard character (``*``) are matched against the test name using :meth:`fnmatch.fnmatchcase`; otherwise simple case-sensitive substring matching is used. Patterns are matched against the fully qualified test method name as imported by the test loader.
Patterns that contain a wildcard character (``*``) are matched against the test name using :meth:`fnmatch.fnmatchcase`; otherwise simple case-sensitive substring matching is used. Patterns are matched against the fully qualified test method name as imported by the test loader.
python, official-docs, cpython, P0
Local_Trusted_Corpus
607a185c-daff-4c1f-9eb0-695cfd7ecb37
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,785
supabase-export-v2
3f83c232ab39d4fa
context manager to test that at least one message is logged on the *logger* or one of its children, with at least the given *level*. If given, *logger* should be a :class:`logging.Logger` object or a :class:`str` giving the name of a logger. The default is the root logger, which will catch all messages that were not ...
trusted_official_docs
CPython Docs
context manager to test that at least one message is logged on the *logger* or one of its children, with at least the given *level*. If given, *logger* should be a :class:`logging.Logger` object or a :class:`str` giving the name of a logger. The default is the root logger, which will catch all messages that were not ...
context manager to test that at least one message is logged on the *logger* or one of its children, with at least the given *level*. If given, *logger* should be a :class:`logging.Logger` object or a :class:`str` giving the name of a logger. The default is the root logger, which will catch all messages that were not ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
60d1b1c8-2689-41c0-bb72-74a15e926328
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,773
supabase-export-v2
026192148260b2e1
.. versionchanged:: next Warnings that do not match the specified category are no longer swallowed. Nested context managers are now supported. .. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds) assertWarnsRegex(warning, regex, *, msg=None)
trusted_official_docs
CPython Docs
.. versionchanged:: next Warnings that do not match the specified category are no longer swallowed. Nested context managers are now supported. .. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds) assertWarnsRegex(warning, regex, *, msg=None)
.. versionchanged:: next Warnings that do not match the specified category are no longer swallowed. Nested context managers are now supported. .. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds) assertWarnsRegex(warning, regex, *, msg=None)
python, official-docs, cpython, P0
Local_Trusted_Corpus
6196c143-047f-4cfc-af8c-ecfb5b104272
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,069
supabase-export-v2
9d79f3473cbf3330
Called when the test case *test* is skipped. *reason* is the reason the test gave for skipping. The default implementation appends a tuple ``(test, reason)`` to the instance's :attr:`skipped` attribute.
trusted_official_docs
CPython Docs
Called when the test case *test* is skipped. *reason* is the reason the test gave for skipping. The default implementation appends a tuple ``(test, reason)`` to the instance's :attr:`skipped` attribute.
Called when the test case *test* is skipped. *reason* is the reason the test gave for skipping. The default implementation appends a tuple ``(test, reason)`` to the instance's :attr:`skipped` attribute.
python, official-docs, cpython, P0
Local_Trusted_Corpus
62ddc807-f5ff-41dc-848c-a79adc8aac2c
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,808
supabase-export-v2
605ea448f18f3e75
.. method:: assertAlmostEqual(first, second, places=7, msg=None, delta=None) assertNotAlmostEqual(first, second, places=7, msg=None, delta=None) Test that *first* and *second* are approximately (or not approximately) equal by computing the difference, rounding to the given number of decimal *places* (default 7), and ...
trusted_official_docs
CPython Docs
.. method:: assertAlmostEqual(first, second, places=7, msg=None, delta=None) assertNotAlmostEqual(first, second, places=7, msg=None, delta=None) Test that *first* and *second* are approximately (or not approximately) equal by computing the difference, rounding to the given number of decimal *places* (default 7), and ...
.. method:: assertAlmostEqual(first, second, places=7, msg=None, delta=None) assertNotAlmostEqual(first, second, places=7, msg=None, delta=None) Test that *first* and *second* are approximately (or not approximately) equal by computing the difference, rounding to the given number of decimal *places* (default 7), and ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
637ccd5c-ac67-44f4-b120-eaf53d1d3839
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,046
supabase-export-v2
f236b9945d5d7d4c
.. method:: stop() This method can be called to signal that the set of tests being run should be aborted by setting the :attr:`shouldStop` attribute to ``True``. :class:`!TestRunner` objects should respect this flag and return without running any additional tests.
trusted_official_docs
CPython Docs
.. method:: stop() This method can be called to signal that the set of tests being run should be aborted by setting the :attr:`shouldStop` attribute to ``True``. :class:`!TestRunner` objects should respect this flag and return without running any additional tests.
.. method:: stop() This method can be called to signal that the set of tests being run should be aborted by setting the :attr:`shouldStop` attribute to ``True``. :class:`!TestRunner` objects should respect this flag and return without running any additional tests.
python, official-docs, cpython, P0
Local_Trusted_Corpus
640f7145-c3c4-448b-832e-26dfd97a6c45
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,753
supabase-export-v2
61c1d3221a943fbe
representation of the raised exception. *regex* may be a regular expression object or a string containing a regular expression suitable for use by :func:`re.search`. Examples:: self.assertRaisesRegex(ValueError, "invalid literal for.*XYZ'$", int, 'XYZ')
trusted_official_docs
CPython Docs
representation of the raised exception. *regex* may be a regular expression object or a string containing a regular expression suitable for use by :func:`re.search`. Examples:: self.assertRaisesRegex(ValueError, "invalid literal for.*XYZ'$", int, 'XYZ')
representation of the raised exception. *regex* may be a regular expression object or a string containing a regular expression suitable for use by :func:`re.search`. Examples:: self.assertRaisesRegex(ValueError, "invalid literal for.*XYZ'$", int, 'XYZ')
python, official-docs, cpython, P0
Local_Trusted_Corpus
64978d7e-3ddc-42ba-b982-5fc4c129a153
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,733
supabase-export-v2
c209a98c16b1891c
.. method:: assertIsInstance(obj, cls, msg=None) assertNotIsInstance(obj, cls, msg=None) Test that *obj* is (or is not) an instance of *cls* (which can be a class or a tuple of classes, as supported by :func:`isinstance`). To check for the exact type, use :func:`assertIs(type(obj), cls) <assertIs>`.
trusted_official_docs
CPython Docs
.. method:: assertIsInstance(obj, cls, msg=None) assertNotIsInstance(obj, cls, msg=None) Test that *obj* is (or is not) an instance of *cls* (which can be a class or a tuple of classes, as supported by :func:`isinstance`). To check for the exact type, use :func:`assertIs(type(obj), cls) <assertIs>`.
.. method:: assertIsInstance(obj, cls, msg=None) assertNotIsInstance(obj, cls, msg=None) Test that *obj* is (or is not) an instance of *cls* (which can be a class or a tuple of classes, as supported by :func:`isinstance`). To check for the exact type, use :func:`assertIs(type(obj), cls) <assertIs>`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
64bf07c5-7506-4739-b2c9-683e383148a2
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,997
supabase-export-v2
e3136c066b1a35e3
are sorted before being imported so that execution order is the same even if the underlying file system's ordering is not dependent on file name. .. versionchanged:: 3.5 Found packages are now checked for ``load_tests`` regardless of whether their path matches *pattern*, because it is impossible for a package name t...
trusted_official_docs
CPython Docs
are sorted before being imported so that execution order is the same even if the underlying file system's ordering is not dependent on file name. .. versionchanged:: 3.5 Found packages are now checked for ``load_tests`` regardless of whether their path matches *pattern*, because it is impossible for a package name t...
are sorted before being imported so that execution order is the same even if the underlying file system's ordering is not dependent on file name. .. versionchanged:: 3.5 Found packages are now checked for ``load_tests`` regardless of whether their path matches *pattern*, because it is impossible for a package name t...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6505435a-37e5-4032-9f50-36d2a7e9dbd3
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,843
supabase-export-v2
3084a8a27f7e84fb
of *seq_type* or a failure will be raised. If the sequences are different an error message is constructed that shows the difference between the two. This method is not called directly by :meth:`assertEqual`, but it's used to implement :meth:`assertListEqual` and :meth:`assertTupleEqual`.
trusted_official_docs
CPython Docs
of *seq_type* or a failure will be raised. If the sequences are different an error message is constructed that shows the difference between the two. This method is not called directly by :meth:`assertEqual`, but it's used to implement :meth:`assertListEqual` and :meth:`assertTupleEqual`.
of *seq_type* or a failure will be raised. If the sequences are different an error message is constructed that shows the difference between the two. This method is not called directly by :meth:`assertEqual`, but it's used to implement :meth:`assertListEqual` and :meth:`assertTupleEqual`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
679883cb-5b20-4cb0-9d87-15e7763a165f
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,115
supabase-export-v2
78cb80e8d1211403
The *failfast*, *catchbreak* and *buffer* parameters have the same effect as the same-name `command-line options`_. The *warnings* argument specifies the :ref:`warning filter <warning-filter>` that should be used while running the tests. If it's not specified, it will remain ``None`` if a :option:`!-W` option is pass...
trusted_official_docs
CPython Docs
The *failfast*, *catchbreak* and *buffer* parameters have the same effect as the same-name `command-line options`_. The *warnings* argument specifies the :ref:`warning filter <warning-filter>` that should be used while running the tests. If it's not specified, it will remain ``None`` if a :option:`!-W` option is pass...
The *failfast*, *catchbreak* and *buffer* parameters have the same effect as the same-name `command-line options`_. The *warnings* argument specifies the :ref:`warning filter <warning-filter>` that should be used while running the tests. If it's not specified, it will remain ``None`` if a :option:`!-W` option is pass...
python, official-docs, cpython, P0
Local_Trusted_Corpus
68cd1ec5-4d5c-4915-8a10-290016f71b73
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,979
supabase-export-v2
45c3d114e81eda2a
The method optionally resolves *name* relative to the given *module*. .. versionchanged:: 3.5 If an :exc:`ImportError` or :exc:`AttributeError` occurs while traversing *name* then a synthetic test that raises that error when run will be returned. These errors are included in the errors accumulated by self.errors.
trusted_official_docs
CPython Docs
The method optionally resolves *name* relative to the given *module*. .. versionchanged:: 3.5 If an :exc:`ImportError` or :exc:`AttributeError` occurs while traversing *name* then a synthetic test that raises that error when run will be returned. These errors are included in the errors accumulated by self.errors.
The method optionally resolves *name* relative to the given *module*. .. versionchanged:: 3.5 If an :exc:`ImportError` or :exc:`AttributeError` occurs while traversing *name* then a synthetic test that raises that error when run will be returned. These errors are included in the errors accumulated by self.errors.
python, official-docs, cpython, P0
Local_Trusted_Corpus
69c05662-456f-4e90-98f6-0bbc89270a49
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,128
supabase-export-v2
14ac3476f4b0d496
It should return a :class:`TestSuite`. *loader* is the instance of :class:`TestLoader` doing the loading. *standard_tests* are the tests that would be loaded by default from the module. It is common for test modules to only want to add or remove tests from the standard set of tests. The third argument is used when load...
trusted_official_docs
CPython Docs
It should return a :class:`TestSuite`. *loader* is the instance of :class:`TestLoader` doing the loading. *standard_tests* are the tests that would be loaded by default from the module. It is common for test modules to only want to add or remove tests from the standard set of tests. The third argument is used when load...
It should return a :class:`TestSuite`. *loader* is the instance of :class:`TestLoader` doing the loading. *standard_tests* are the tests that would be loaded by default from the module. It is common for test modules to only want to add or remove tests from the standard set of tests. The third argument is used when load...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6d3af9a7-4c76-47fe-8cf1-518673ddbb35
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,583
supabase-export-v2
a9452eab7d021cca
Organizing test code -------------------- The basic building blocks of unit testing are :dfn:`test cases` --- single scenarios that must be set up and checked for correctness. In :mod:`!unittest`, test cases are represented by :class:`unittest.TestCase` instances. To make your own test cases you must write subclasses o...
trusted_official_docs
CPython Docs
Organizing test code -------------------- The basic building blocks of unit testing are :dfn:`test cases` --- single scenarios that must be set up and checked for correctness. In :mod:`!unittest`, test cases are represented by :class:`unittest.TestCase` instances. To make your own test cases you must write subclasses o...
Organizing test code -------------------- The basic building blocks of unit testing are :dfn:`test cases` --- single scenarios that must be set up and checked for correctness. In :mod:`!unittest`, test cases are represented by :class:`unittest.TestCase` instances. To make your own test cases you must write subclasses o...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6dde9715-37ec-4bc6-a494-dba7adcac106
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,489
supabase-export-v2
97fa9e144ad0c977
`The Python Testing Tools Taxonomy <https://wiki.python.org/moin/PythonTestingToolsTaxonomy>`_ An extensive list of Python testing tools including functional testing frameworks and mock object libraries. `Testing in Python Mailing List <http://lists.idyll.org/listinfo/testing-in-python>`_ A special-interest-group for ...
trusted_official_docs
CPython Docs
`The Python Testing Tools Taxonomy <https://wiki.python.org/moin/PythonTestingToolsTaxonomy>`_ An extensive list of Python testing tools including functional testing frameworks and mock object libraries. `Testing in Python Mailing List <http://lists.idyll.org/listinfo/testing-in-python>`_ A special-interest-group for ...
`The Python Testing Tools Taxonomy <https://wiki.python.org/moin/PythonTestingToolsTaxonomy>`_ An extensive list of Python testing tools including functional testing frameworks and mock object libraries. `Testing in Python Mailing List <http://lists.idyll.org/listinfo/testing-in-python>`_ A special-interest-group for ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6dfcd2ad-dc53-429b-be37-9c981de33ed6
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,873
supabase-export-v2
7ded30dda790b71c
.. method:: defaultTestResult() Return an instance of the test result class that should be used for this test case class (if no other result instance is provided to the :meth:`run` method).
trusted_official_docs
CPython Docs
.. method:: defaultTestResult() Return an instance of the test result class that should be used for this test case class (if no other result instance is provided to the :meth:`run` method).
.. method:: defaultTestResult() Return an instance of the test result class that should be used for this test case class (if no other result instance is provided to the :meth:`run` method).
python, official-docs, cpython, P0
Local_Trusted_Corpus
6e45bbd3-9e8e-4ff7-8c42-53a810903e1c
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,893
supabase-export-v2
30025d47ca5caa83
to the order they are added (:abbr:`LIFO (last-in, first-out)`). They are called with any arguments and keyword arguments passed into :meth:`addClassCleanup` when they are added. If :meth:`setUpClass` fails, meaning that :meth:`tearDownClass` is not called, then any cleanup functions added will still be called.
trusted_official_docs
CPython Docs
to the order they are added (:abbr:`LIFO (last-in, first-out)`). They are called with any arguments and keyword arguments passed into :meth:`addClassCleanup` when they are added. If :meth:`setUpClass` fails, meaning that :meth:`tearDownClass` is not called, then any cleanup functions added will still be called.
to the order they are added (:abbr:`LIFO (last-in, first-out)`). They are called with any arguments and keyword arguments passed into :meth:`addClassCleanup` when they are added. If :meth:`setUpClass` fails, meaning that :meth:`tearDownClass` is not called, then any cleanup functions added will still be called.
python, official-docs, cpython, P0
Local_Trusted_Corpus
6ed5f3ae-bb77-4104-a1e6-20621cd80c0a
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,093
supabase-export-v2
a78bbae3d0da3188
are :ref:`ignored by default <warning-ignored>`. This behavior can be overridden using Python's :option:`!-Wd` or :option:`!-Wa` options (see :ref:`Warning control <using-on-warnings>`) and leaving *warnings* to ``None``. .. versionchanged:: 3.2 Added the *warnings* parameter.
trusted_official_docs
CPython Docs
are :ref:`ignored by default <warning-ignored>`. This behavior can be overridden using Python's :option:`!-Wd` or :option:`!-Wa` options (see :ref:`Warning control <using-on-warnings>`) and leaving *warnings* to ``None``. .. versionchanged:: 3.2 Added the *warnings* parameter.
are :ref:`ignored by default <warning-ignored>`. This behavior can be overridden using Python's :option:`!-Wd` or :option:`!-Wa` options (see :ref:`Warning control <using-on-warnings>`) and leaving *warnings* to ``None``. .. versionchanged:: 3.2 Added the *warnings* parameter.
python, official-docs, cpython, P0
Local_Trusted_Corpus
710b223b-6848-4c2f-8107-11471527aeb9
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,672
supabase-export-v2
4183f1b7018e16d6
subtest, execution would stop after the first failure, and the error would be less easy to diagnose because the value of ``i`` wouldn't be displayed:: ====================================================================== FAIL: test_even (__main__.NumbersTest.test_even) -----------------------------------------------...
trusted_official_docs
CPython Docs
subtest, execution would stop after the first failure, and the error would be less easy to diagnose because the value of ``i`` wouldn't be displayed:: ====================================================================== FAIL: test_even (__main__.NumbersTest.test_even) -----------------------------------------------...
subtest, execution would stop after the first failure, and the error would be less easy to diagnose because the value of ``i`` wouldn't be displayed:: ====================================================================== FAIL: test_even (__main__.NumbersTest.test_even) -----------------------------------------------...
python, official-docs, cpython, P0
Local_Trusted_Corpus
74911531-95ac-492b-ac41-b7d04f80f2b8
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,981
supabase-export-v2
9d161b2e349df5d1
.. method:: loadTestsFromNames(names, module=None) Similar to :meth:`loadTestsFromName`, but takes a sequence of names rather than a single name. The return value is a test suite which supports all the tests defined for each name.
trusted_official_docs
CPython Docs
.. method:: loadTestsFromNames(names, module=None) Similar to :meth:`loadTestsFromName`, but takes a sequence of names rather than a single name. The return value is a test suite which supports all the tests defined for each name.
.. method:: loadTestsFromNames(names, module=None) Similar to :meth:`loadTestsFromName`, but takes a sequence of names rather than a single name. The return value is a test suite which supports all the tests defined for each name.
python, official-docs, cpython, P0
Local_Trusted_Corpus
753ff9e9-450b-4a10-9fd0-1b53866bb67d
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,879
supabase-export-v2
e96337a338af896d
if no description has been provided. The default implementation of this method returns the first line of the test method's docstring, if available, or ``None``. .. versionchanged:: 3.1 In 3.1 this was changed to add the test name to the short description even in the presence of a docstring. This caused compatibility ...
trusted_official_docs
CPython Docs
if no description has been provided. The default implementation of this method returns the first line of the test method's docstring, if available, or ``None``. .. versionchanged:: 3.1 In 3.1 this was changed to add the test name to the short description even in the presence of a docstring. This caused compatibility ...
if no description has been provided. The default implementation of this method returns the first line of the test method's docstring, if available, or ``None``. .. versionchanged:: 3.1 In 3.1 this was changed to add the test name to the short description even in the presence of a docstring. This caused compatibility ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
773f0c28-e981-4412-9ce1-6e2221958202
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,708
supabase-export-v2
06f93092bc9bb43d
.. method:: debug() Run the test without collecting the result. This allows exceptions raised by the test to be propagated to the caller, and can be used to support running tests under a debugger.
trusted_official_docs
CPython Docs
.. method:: debug() Run the test without collecting the result. This allows exceptions raised by the test to be propagated to the caller, and can be used to support running tests under a debugger.
.. method:: debug() Run the test without collecting the result. This allows exceptions raised by the test to be propagated to the caller, and can be used to support running tests under a debugger.
python, official-docs, cpython, P0
Local_Trusted_Corpus
790f4e9d-6139-46fd-91e2-3bcfe819e89c
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,607
supabase-export-v2
a6521151b1c0d496
code they are to test (such as :file:`widget.py`), but there are several advantages to placing the test code in a separate module, such as :file:`test_widget.py`: * The test module can be run standalone from the command line.
trusted_official_docs
CPython Docs
code they are to test (such as :file:`widget.py`), but there are several advantages to placing the test code in a separate module, such as :file:`test_widget.py`: * The test module can be run standalone from the command line.
code they are to test (such as :file:`widget.py`), but there are several advantages to placing the test code in a separate module, such as :file:`test_widget.py`: * The test module can be run standalone from the command line.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7ae5f034-5089-491c-845d-4255a0baf2f2
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,805
supabase-export-v2
66ad22654e0d63c0
There are also other methods used to perform more specific checks, such as: +---------------------------------------+--------------------------------+--------------+ | Method | Checks that | New in | +=======================================+================================+==============+ | :meth:`assertAlmostEqual(...
trusted_official_docs
CPython Docs
There are also other methods used to perform more specific checks, such as: +---------------------------------------+--------------------------------+--------------+ | Method | Checks that | New in | +=======================================+================================+==============+ | :meth:`assertAlmostEqual(...
There are also other methods used to perform more specific checks, such as: +---------------------------------------+--------------------------------+--------------+ | Method | Checks that | New in | +=======================================+================================+==============+ | :meth:`assertAlmostEqual(...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7b8d6590-eca8-4ea9-a91b-f3e97c9e6d39
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,860
supabase-export-v2
0ef0239d89b5106c
.. attribute:: failureException This class attribute gives the exception raised by the test method. If a test framework needs to use a specialized exception, possibly to carry additional information, it must subclass this exception in order to "play fair" with the framework. The initial value of this attribute is :...
trusted_official_docs
CPython Docs
.. attribute:: failureException This class attribute gives the exception raised by the test method. If a test framework needs to use a specialized exception, possibly to carry additional information, it must subclass this exception in order to "play fair" with the framework. The initial value of this attribute is :...
.. attribute:: failureException This class attribute gives the exception raised by the test method. If a test framework needs to use a specialized exception, possibly to carry additional information, it must subclass this exception in order to "play fair" with the framework. The initial value of this attribute is :...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7df13458-55d9-4240-89b3-cbd7d3537644
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,915
supabase-export-v2
dafee1ac8193894d
.. method:: enterAsyncContext(cm) :async: Enter the supplied :term:`asynchronous context manager`. If successful, also add its :meth:`~object.__aexit__` method as a cleanup function by :meth:`addAsyncCleanup` and return the result of the :meth:`~object.__aenter__` method.
trusted_official_docs
CPython Docs
.. method:: enterAsyncContext(cm) :async: Enter the supplied :term:`asynchronous context manager`. If successful, also add its :meth:`~object.__aexit__` method as a cleanup function by :meth:`addAsyncCleanup` and return the result of the :meth:`~object.__aenter__` method.
.. method:: enterAsyncContext(cm) :async: Enter the supplied :term:`asynchronous context manager`. If successful, also add its :meth:`~object.__aexit__` method as a cleanup function by :meth:`addAsyncCleanup` and return the result of the :meth:`~object.__aenter__` method.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7eb8e51e-4502-4df8-b16f-12e24240a0ef
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,947
supabase-export-v2
875227fa769c23d6
.. method:: debug() Run the tests associated with this suite without collecting the result. This allows exceptions raised by the test to be propagated to the caller and can be used to support running tests under a debugger.
trusted_official_docs
CPython Docs
.. method:: debug() Run the tests associated with this suite without collecting the result. This allows exceptions raised by the test to be propagated to the caller and can be used to support running tests under a debugger.
.. method:: debug() Run the tests associated with this suite without collecting the result. This allows exceptions raised by the test to be propagated to the caller and can be used to support running tests under a debugger.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7f30cbeb-f414-4b13-a3ca-68ffaa73a5d2
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,479
supabase-export-v2
f6867cb1f241b4ad
supports test automation, sharing of setup and shutdown code for tests, aggregation of tests into collections, and independence of the tests from the reporting framework. To achieve this, :mod:`!unittest` supports some important concepts in an object-oriented way:
trusted_official_docs
CPython Docs
supports test automation, sharing of setup and shutdown code for tests, aggregation of tests into collections, and independence of the tests from the reporting framework. To achieve this, :mod:`!unittest` supports some important concepts in an object-oriented way:
supports test automation, sharing of setup and shutdown code for tests, aggregation of tests into collections, and independence of the tests from the reporting framework. To achieve this, :mod:`!unittest` supports some important concepts in an object-oriented way:
python, official-docs, cpython, P0
Local_Trusted_Corpus
7f9bdd69-47bd-4d8d-a456-b734625d9b3b
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,723
supabase-export-v2
5d05e8526f6262c4
when more specific methods are available (e.g. ``assertEqual(a, b)`` instead of ``assertTrue(a == b)``), because they provide a better error message in case of failure. .. method:: assertIs(first, second, msg=None) assertIsNot(first, second, msg=None)
trusted_official_docs
CPython Docs
when more specific methods are available (e.g. ``assertEqual(a, b)`` instead of ``assertTrue(a == b)``), because they provide a better error message in case of failure. .. method:: assertIs(first, second, msg=None) assertIsNot(first, second, msg=None)
when more specific methods are available (e.g. ``assertEqual(a, b)`` instead of ``assertTrue(a == b)``), because they provide a better error message in case of failure. .. method:: assertIs(first, second, msg=None) assertIsNot(first, second, msg=None)
python, official-docs, cpython, P0
Local_Trusted_Corpus
800633e2-b571-4ccc-8746-510424e150eb
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,978
supabase-export-v2
b379a9abec16c05a
only the :meth:`!test_two` test method. The specifier can refer to modules and packages which have not been imported; they will be imported as a side-effect. The method optionally resolves *name* relative to the given *module*.
trusted_official_docs
CPython Docs
only the :meth:`!test_two` test method. The specifier can refer to modules and packages which have not been imported; they will be imported as a side-effect. The method optionally resolves *name* relative to the given *module*.
only the :meth:`!test_two` test method. The specifier can refer to modules and packages which have not been imported; they will be imported as a side-effect. The method optionally resolves *name* relative to the given *module*.
python, official-docs, cpython, P0
Local_Trusted_Corpus
800b114a-33a2-4e0e-8b8c-81b89b9ba809
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,713
supabase-export-v2
f3a336438e54c1a4
also :data:`longMessage`). Note that the *msg* keyword argument can be passed to :meth:`assertRaises`, :meth:`assertRaisesRegex`, :meth:`assertWarns`, :meth:`assertWarnsRegex` only when they are used as a context manager. .. method:: assertEqual(first, second, msg=None)
trusted_official_docs
CPython Docs
also :data:`longMessage`). Note that the *msg* keyword argument can be passed to :meth:`assertRaises`, :meth:`assertRaisesRegex`, :meth:`assertWarns`, :meth:`assertWarnsRegex` only when they are used as a context manager. .. method:: assertEqual(first, second, msg=None)
also :data:`longMessage`). Note that the *msg* keyword argument can be passed to :meth:`assertRaises`, :meth:`assertRaisesRegex`, :meth:`assertWarns`, :meth:`assertWarnsRegex` only when they are used as a context manager. .. method:: assertEqual(first, second, msg=None)
python, official-docs, cpython, P0
Local_Trusted_Corpus
806ecd4f-c0f5-4347-866f-36a1859d764d
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,079
supabase-export-v2
f150862a046ca06d
is :const:`None`, the subtest succeeded. Otherwise, it failed with an exception where *outcome* is a tuple of the form returned by :func:`sys.exc_info`: ``(type, value, traceback)``. The default implementation does nothing when the outcome is a success, and records subtest failures as normal failures.
trusted_official_docs
CPython Docs
is :const:`None`, the subtest succeeded. Otherwise, it failed with an exception where *outcome* is a tuple of the form returned by :func:`sys.exc_info`: ``(type, value, traceback)``. The default implementation does nothing when the outcome is a success, and records subtest failures as normal failures.
is :const:`None`, the subtest succeeded. Otherwise, it failed with an exception where *outcome* is a tuple of the form returned by :func:`sys.exc_info`: ``(type, value, traceback)``. The default implementation does nothing when the outcome is a success, and records subtest failures as normal failures.
python, official-docs, cpython, P0
Local_Trusted_Corpus
81149422-b7e0-4b71-8d8a-dd5404c2aa85
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,044
supabase-export-v2
abeb3cc0f916a86f
Return ``True`` if all tests run so far have passed, otherwise returns ``False``. .. versionchanged:: 3.4 Returns ``False`` if there were any :attr:`unexpectedSuccesses` from tests marked with the :func:`expectedFailure` decorator.
trusted_official_docs
CPython Docs
Return ``True`` if all tests run so far have passed, otherwise returns ``False``. .. versionchanged:: 3.4 Returns ``False`` if there were any :attr:`unexpectedSuccesses` from tests marked with the :func:`expectedFailure` decorator.
Return ``True`` if all tests run so far have passed, otherwise returns ``False``. .. versionchanged:: 3.4 Returns ``False`` if there were any :attr:`unexpectedSuccesses` from tests marked with the :func:`expectedFailure` decorator.
python, official-docs, cpython, P0
Local_Trusted_Corpus
8334728c-e8a5-4304-904b-06f4a72fba1c
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,009
supabase-export-v2
c3009bb48ce02123
that constructs a test suite from a list of tests. No methods on the resulting object are needed. The default value is the :class:`TestSuite` class. This affects all the ``loadTestsFrom*`` methods.
trusted_official_docs
CPython Docs
that constructs a test suite from a list of tests. No methods on the resulting object are needed. The default value is the :class:`TestSuite` class. This affects all the ``loadTestsFrom*`` methods.
that constructs a test suite from a list of tests. No methods on the resulting object are needed. The default value is the :class:`TestSuite` class. This affects all the ``loadTestsFrom*`` methods.
python, official-docs, cpython, P0
Local_Trusted_Corpus
833c5a70-26d2-49cf-a5fe-f18f3eacaa38
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,678
supabase-export-v2
d8c2c0783db34fce
.. class:: TestCase(methodName='runTest') Instances of the :class:`TestCase` class represent the logical test units in the :mod:`!unittest` universe. This class is intended to be used as a base class, with specific tests being implemented by concrete subclasses. This class implements the interface needed by the test...
trusted_official_docs
CPython Docs
.. class:: TestCase(methodName='runTest') Instances of the :class:`TestCase` class represent the logical test units in the :mod:`!unittest` universe. This class is intended to be used as a base class, with specific tests being implemented by concrete subclasses. This class implements the interface needed by the test...
.. class:: TestCase(methodName='runTest') Instances of the :class:`TestCase` class represent the logical test units in the :mod:`!unittest` universe. This class is intended to be used as a base class, with specific tests being implemented by concrete subclasses. This class implements the interface needed by the test...
python, official-docs, cpython, P0
Local_Trusted_Corpus
83f53f7a-02eb-4ee4-af17-e42f46477be9
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,867
supabase-export-v2
4a136f1cf4a223e5
defaults to 80*8 characters. Assert methods affected by this attribute are :meth:`assertSequenceEqual` (including all the sequence comparison methods that delegate to it), :meth:`assertDictEqual` and :meth:`assertMultiLineEqual`. Setting ``maxDiff`` to ``None`` means that there is no maximum length of diffs.
trusted_official_docs
CPython Docs
defaults to 80*8 characters. Assert methods affected by this attribute are :meth:`assertSequenceEqual` (including all the sequence comparison methods that delegate to it), :meth:`assertDictEqual` and :meth:`assertMultiLineEqual`. Setting ``maxDiff`` to ``None`` means that there is no maximum length of diffs.
defaults to 80*8 characters. Assert methods affected by this attribute are :meth:`assertSequenceEqual` (including all the sequence comparison methods that delegate to it), :meth:`assertDictEqual` and :meth:`assertMultiLineEqual`. Setting ``maxDiff`` to ``None`` means that there is no maximum length of diffs.
python, official-docs, cpython, P0
Local_Trusted_Corpus
86541138-aae1-4f7c-8bc2-608b9c67e493
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,765
supabase-export-v2
f87ba2253a136574
triggered the warnings in the :attr:`!filename` and :attr:`!lineno` attributes. This can be useful if the intention is to perform additional checks on the warning caught:: with self.assertWarns(SomeWarning) as cm: do_something()
trusted_official_docs
CPython Docs
triggered the warnings in the :attr:`!filename` and :attr:`!lineno` attributes. This can be useful if the intention is to perform additional checks on the warning caught:: with self.assertWarns(SomeWarning) as cm: do_something()
triggered the warnings in the :attr:`!filename` and :attr:`!lineno` attributes. This can be useful if the intention is to perform additional checks on the warning caught:: with self.assertWarns(SomeWarning) as cm: do_something()
python, official-docs, cpython, P0
Local_Trusted_Corpus
87386b66-9c22-4bd6-abe3-370b8d8d277b
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,901
supabase-export-v2
4ecb5a47b3e385ab
calling all the cleanup functions added by :meth:`addClassCleanup`. If you need cleanup functions to be called *prior* to :meth:`tearDownClass` then you can call :meth:`doClassCleanups` yourself. :meth:`doClassCleanups` pops methods off the stack of cleanup functions one at a time, so it can be called at any time.
trusted_official_docs
CPython Docs
calling all the cleanup functions added by :meth:`addClassCleanup`. If you need cleanup functions to be called *prior* to :meth:`tearDownClass` then you can call :meth:`doClassCleanups` yourself. :meth:`doClassCleanups` pops methods off the stack of cleanup functions one at a time, so it can be called at any time.
calling all the cleanup functions added by :meth:`addClassCleanup`. If you need cleanup functions to be called *prior* to :meth:`tearDownClass` then you can call :meth:`doClassCleanups` yourself. :meth:`doClassCleanups` pops methods off the stack of cleanup functions one at a time, so it can be called at any time.
python, official-docs, cpython, P0
Local_Trusted_Corpus
87640565-220f-4fa9-8cd5-d60f4dfccecf
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,782
supabase-export-v2
2ec2b40ec0bd710c
.. versionchanged:: 3.3 Added the *msg* keyword argument when used as a context manager. .. versionchanged:: next Warnings that do not match the specified category or regex are no longer swallowed. Nested context managers are now supported.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.3 Added the *msg* keyword argument when used as a context manager. .. versionchanged:: next Warnings that do not match the specified category or regex are no longer swallowed. Nested context managers are now supported.
.. versionchanged:: 3.3 Added the *msg* keyword argument when used as a context manager. .. versionchanged:: next Warnings that do not match the specified category or regex are no longer swallowed. Nested context managers are now supported.
python, official-docs, cpython, P0
Local_Trusted_Corpus
8a0a1cba-911f-4f5d-a271-5b0e3aab4c30
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,481
supabase-export-v2
a215fe1a35f6e294
one or more tests, and any associated cleanup actions. This may involve, for example, creating temporary or proxy databases, directories, or starting a server process. test case A :dfn:`test case` is the individual unit of testing. It checks for a specific response to a particular set of inputs. :mod:`!unittest` prov...
trusted_official_docs
CPython Docs
one or more tests, and any associated cleanup actions. This may involve, for example, creating temporary or proxy databases, directories, or starting a server process. test case A :dfn:`test case` is the individual unit of testing. It checks for a specific response to a particular set of inputs. :mod:`!unittest` prov...
one or more tests, and any associated cleanup actions. This may involve, for example, creating temporary or proxy databases, directories, or starting a server process. test case A :dfn:`test case` is the individual unit of testing. It checks for a specific response to a particular set of inputs. :mod:`!unittest` prov...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8b21b66a-06d2-4484-89e8-0c9d380acfca
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,629
supabase-export-v2
c62698d4e2a5959f
marking a test as an "expected failure," a test that is broken and will fail, but shouldn't be counted as a failure on a :class:`TestResult`. Skipping a test is simply a matter of using the :func:`skip` :term:`decorator` or one of its conditional variants, calling :meth:`TestCase.skipTest` within a :meth:`~TestCase.set...
trusted_official_docs
CPython Docs
marking a test as an "expected failure," a test that is broken and will fail, but shouldn't be counted as a failure on a :class:`TestResult`. Skipping a test is simply a matter of using the :func:`skip` :term:`decorator` or one of its conditional variants, calling :meth:`TestCase.skipTest` within a :meth:`~TestCase.set...
marking a test as an "expected failure," a test that is broken and will fail, but shouldn't be counted as a failure on a :class:`TestResult`. Skipping a test is simply a matter of using the :func:`skip` :term:`decorator` or one of its conditional variants, calling :meth:`TestCase.skipTest` within a :meth:`~TestCase.set...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8bde76ec-69e6-46f3-8746-cdfe7ae0638b
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,722
supabase-export-v2
e6438635997bd30f
Test that *expr* is true (or false). Note that this is equivalent to ``bool(expr) is True`` and not to ``expr is True`` (use ``assertIs(expr, True)`` for the latter). This method should also be avoided when more specific methods are available (e.g. ``assertEqual(a, b)`` instead of ``assertTrue(a == b)``), because the...
trusted_official_docs
CPython Docs
Test that *expr* is true (or false). Note that this is equivalent to ``bool(expr) is True`` and not to ``expr is True`` (use ``assertIs(expr, True)`` for the latter). This method should also be avoided when more specific methods are available (e.g. ``assertEqual(a, b)`` instead of ``assertTrue(a == b)``), because the...
Test that *expr* is true (or false). Note that this is equivalent to ``bool(expr) is True`` and not to ``expr is True`` (use ``assertIs(expr, True)`` for the latter). This method should also be avoided when more specific methods are available (e.g. ``assertEqual(a, b)`` instead of ``assertTrue(a == b)``), because the...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8c0e8d49-ea38-4fa7-b58a-e96d2e0725ea
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,181
supabase-export-v2
3ffe71d3c08d7595
a :class:`TestResult` object for control-c handling. Registering a result stores a weak reference to it, so it doesn't prevent the result from being garbage collected. Registering a :class:`TestResult` object has no side-effects if control-c handling is not enabled, so test frameworks can unconditionally register all...
trusted_official_docs
CPython Docs
a :class:`TestResult` object for control-c handling. Registering a result stores a weak reference to it, so it doesn't prevent the result from being garbage collected. Registering a :class:`TestResult` object has no side-effects if control-c handling is not enabled, so test frameworks can unconditionally register all...
a :class:`TestResult` object for control-c handling. Registering a result stores a weak reference to it, so it doesn't prevent the result from being garbage collected. Registering a :class:`TestResult` object has no side-effects if control-c handling is not enabled, so test frameworks can unconditionally register all...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8ce742ae-8a5f-4f6c-9949-e6ac88e5e440
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,957
supabase-export-v2
401f16dc67bc0692
.. class:: TestLoader() The :class:`TestLoader` class is used to create test suites from classes and modules. Normally, there is no need to create an instance of this class; the :mod:`!unittest` module provides an instance that can be shared as :data:`unittest.defaultTestLoader`. Using a subclass or instance, howeve...
trusted_official_docs
CPython Docs
.. class:: TestLoader() The :class:`TestLoader` class is used to create test suites from classes and modules. Normally, there is no need to create an instance of this class; the :mod:`!unittest` module provides an instance that can be shared as :data:`unittest.defaultTestLoader`. Using a subclass or instance, howeve...
.. class:: TestLoader() The :class:`TestLoader` class is used to create test suites from classes and modules. Normally, there is no need to create an instance of this class; the :mod:`!unittest` module provides an instance that can be shared as :data:`unittest.defaultTestLoader`. Using a subclass or instance, howeve...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8da144f3-521f-4b80-826b-042bb1a748a8
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,501
supabase-export-v2
9a8aef0037938ded
if __name__ == '__main__': unittest.main() A test case is created by subclassing :class:`unittest.TestCase`. The three individual tests are defined with methods whose names start with the letters ``test``. This naming convention informs the test runner about which methods represent tests.
trusted_official_docs
CPython Docs
if __name__ == '__main__': unittest.main() A test case is created by subclassing :class:`unittest.TestCase`. The three individual tests are defined with methods whose names start with the letters ``test``. This naming convention informs the test runner about which methods represent tests.
if __name__ == '__main__': unittest.main() A test case is created by subclassing :class:`unittest.TestCase`. The three individual tests are defined with methods whose names start with the letters ``test``. This naming convention informs the test runner about which methods represent tests.
python, official-docs, cpython, P0
Local_Trusted_Corpus
8f36bd09-b855-41f6-bd78-28b701354f76
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,863
supabase-export-v2
af614016140146f2
case, the custom message is appended to the end of the standard failure message. When set to ``False``, the custom message replaces the standard message. The class setting can be overridden in individual test methods by assigning an instance attribute, self.longMessage, to ``True`` or ``False`` before calling the ass...
trusted_official_docs
CPython Docs
case, the custom message is appended to the end of the standard failure message. When set to ``False``, the custom message replaces the standard message. The class setting can be overridden in individual test methods by assigning an instance attribute, self.longMessage, to ``True`` or ``False`` before calling the ass...
case, the custom message is appended to the end of the standard failure message. When set to ``False``, the custom message replaces the standard message. The class setting can be overridden in individual test methods by assigning an instance attribute, self.longMessage, to ``True`` or ``False`` before calling the ass...
python, official-docs, cpython, P0
Local_Trusted_Corpus
9216cf22-631a-450e-af15-7769b9d56be8
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,878
supabase-export-v2
a22cd1bb331a12bc
.. method:: shortDescription() Returns a description of the test, or ``None`` if no description has been provided. The default implementation of this method returns the first line of the test method's docstring, if available, or ``None``.
trusted_official_docs
CPython Docs
.. method:: shortDescription() Returns a description of the test, or ``None`` if no description has been provided. The default implementation of this method returns the first line of the test method's docstring, if available, or ``None``.
.. method:: shortDescription() Returns a description of the test, or ``None`` if no description has been provided. The default implementation of this method returns the first line of the test method's docstring, if available, or ``None``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
93c30cb9-c86f-46c8-a723-80afbc01fc51
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,789
supabase-export-v2
93d7b3ea80298d42
The test passes if at least one message emitted inside the ``with`` block matches the *logger* and *level* conditions, otherwise it fails. The object returned by the context manager is a recording helper which keeps tracks of the matching log messages. It has two attributes:
trusted_official_docs
CPython Docs
The test passes if at least one message emitted inside the ``with`` block matches the *logger* and *level* conditions, otherwise it fails. The object returned by the context manager is a recording helper which keeps tracks of the matching log messages. It has two attributes:
The test passes if at least one message emitted inside the ``with`` block matches the *logger* and *level* conditions, otherwise it fails. The object returned by the context manager is a recording helper which keeps tracks of the matching log messages. It has two attributes:
python, official-docs, cpython, P0
Local_Trusted_Corpus
9487be13-e052-42de-aae2-d13ed7530144
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,992
supabase-export-v2
b7fde1c98350f954
as a default to any nested calls to ``discover()``. That is, if a package's ``load_tests`` calls ``loader.discover()``, it does not need to pass this argument. *start_dir* can be a dotted module name as well as a directory.
trusted_official_docs
CPython Docs
as a default to any nested calls to ``discover()``. That is, if a package's ``load_tests`` calls ``loader.discover()``, it does not need to pass this argument. *start_dir* can be a dotted module name as well as a directory.
as a default to any nested calls to ``discover()``. That is, if a package's ``load_tests`` calls ``loader.discover()``, it does not need to pass this argument. *start_dir* can be a dotted module name as well as a directory.
python, official-docs, cpython, P0
Local_Trusted_Corpus
9555d81c-2bc6-4716-892a-3a978e666870
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,494
supabase-export-v2
c66825bee7a22a43
of tools for constructing and running tests. This section demonstrates that a small subset of the tools suffice to meet the needs of most users. Here is a short script to test three string methods::
trusted_official_docs
CPython Docs
of tools for constructing and running tests. This section demonstrates that a small subset of the tools suffice to meet the needs of most users. Here is a short script to test three string methods::
of tools for constructing and running tests. This section demonstrates that a small subset of the tools suffice to meet the needs of most users. Here is a short script to test three string methods::
python, official-docs, cpython, P0
Local_Trusted_Corpus
95d6705b-19fb-47ab-9260-3be83925630a
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,810
supabase-export-v2
48f13ffbae82c4eb
If *delta* is supplied instead of *places* then the difference between *first* and *second* must be less or equal to (or greater than) *delta*. Supplying both *delta* and *places* raises a :exc:`TypeError`.
trusted_official_docs
CPython Docs
If *delta* is supplied instead of *places* then the difference between *first* and *second* must be less or equal to (or greater than) *delta*. Supplying both *delta* and *places* raises a :exc:`TypeError`.
If *delta* is supplied instead of *places* then the difference between *first* and *second* must be less or equal to (or greater than) *delta*. Supplying both *delta* and *places* raises a :exc:`TypeError`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
9623a7c6-9d1e-41d6-82ea-a200bfc1f445
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,078
supabase-export-v2
2b3f8215ff5b2f35
Called when a subtest finishes. *test* is the test case corresponding to the test method. *subtest* is a custom :class:`TestCase` instance describing the subtest. If *outcome* is :const:`None`, the subtest succeeded. Otherwise, it failed with an exception where *outcome* is a tuple of the form returned by :func:`sys....
trusted_official_docs
CPython Docs
Called when a subtest finishes. *test* is the test case corresponding to the test method. *subtest* is a custom :class:`TestCase` instance describing the subtest. If *outcome* is :const:`None`, the subtest succeeded. Otherwise, it failed with an exception where *outcome* is a tuple of the form returned by :func:`sys....
Called when a subtest finishes. *test* is the test case corresponding to the test method. *subtest* is a custom :class:`TestCase` instance describing the subtest. If *outcome* is :const:`None`, the subtest succeeded. Otherwise, it failed with an exception where *outcome* is a tuple of the form returned by :func:`sys....
python, official-docs, cpython, P0
Local_Trusted_Corpus
99335563-9c0f-4ec6-a638-b83314d63753
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,091
supabase-export-v2
005f15ce53f8a5a6
.. class:: TextTestRunner(stream=None, descriptions=True, verbosity=1, failfast=False, \ buffer=False, resultclass=None, warnings=None, *, \ tb_locals=False, durations=None) A basic test runner implementation that outputs results to a stream. If *stream* is ``None``, the default, :data:`sys.stderr` is used as the outp...
trusted_official_docs
CPython Docs
.. class:: TextTestRunner(stream=None, descriptions=True, verbosity=1, failfast=False, \ buffer=False, resultclass=None, warnings=None, *, \ tb_locals=False, durations=None) A basic test runner implementation that outputs results to a stream. If *stream* is ``None``, the default, :data:`sys.stderr` is used as the outp...
.. class:: TextTestRunner(stream=None, descriptions=True, verbosity=1, failfast=False, \ buffer=False, resultclass=None, warnings=None, *, \ tb_locals=False, durations=None) A basic test runner implementation that outputs results to a stream. If *stream* is ``None``, the default, :data:`sys.stderr` is used as the outp...
python, official-docs, cpython, P0
Local_Trusted_Corpus
99521f3a-bbad-45d1-bfb1-f95f033c9447
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,969
supabase-export-v2
941d571a7ab6cb59
.. note:: While using a hierarchy of :class:`TestCase`\ -derived classes can be convenient in sharing fixtures and helper functions, defining test methods on base classes that are not intended to be instantiated directly does not play well with this method. Doing so, however, can be useful when the fixtures are dif...
trusted_official_docs
CPython Docs
.. note:: While using a hierarchy of :class:`TestCase`\ -derived classes can be convenient in sharing fixtures and helper functions, defining test methods on base classes that are not intended to be instantiated directly does not play well with this method. Doing so, however, can be useful when the fixtures are dif...
.. note:: While using a hierarchy of :class:`TestCase`\ -derived classes can be convenient in sharing fixtures and helper functions, defining test methods on base classes that are not intended to be instantiated directly does not play well with this method. Doing so, however, can be useful when the fixtures are dif...
python, official-docs, cpython, P0
Local_Trusted_Corpus
997768f1-5c5a-4f2c-b575-8fb2c7074b67
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,505
supabase-export-v2
6e4f73e8e19a696a
:func:`unittest.main` provides a command-line interface to the test script. When run from the command line, the above script produces an output that looks like this:: ... ---------------------------------------------------------------------- Ran 3 tests in 0.000s
trusted_official_docs
CPython Docs
:func:`unittest.main` provides a command-line interface to the test script. When run from the command line, the above script produces an output that looks like this:: ... ---------------------------------------------------------------------- Ran 3 tests in 0.000s
:func:`unittest.main` provides a command-line interface to the test script. When run from the command line, the above script produces an output that looks like this:: ... ---------------------------------------------------------------------- Ran 3 tests in 0.000s
python, official-docs, cpython, P0
Local_Trusted_Corpus
99a97264-be20-42a4-93ea-d00134c83f25
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,670
supabase-export-v2
80b191f9b7013dfc
5 are all even. ---------------------------------------------------------------------- Traceback (most recent call last): File "subtests.py", line 11, in test_even self.assertEqual(i % 2, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 1 != 0 ====================================================================== FAIL: t...
trusted_official_docs
CPython Docs
5 are all even. ---------------------------------------------------------------------- Traceback (most recent call last): File "subtests.py", line 11, in test_even self.assertEqual(i % 2, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 1 != 0 ====================================================================== FAIL: t...
5 are all even. ---------------------------------------------------------------------- Traceback (most recent call last): File "subtests.py", line 11, in test_even self.assertEqual(i % 2, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 1 != 0 ====================================================================== FAIL: t...
python, official-docs, cpython, P0
Local_Trusted_Corpus
99c3fd2f-cd70-492d-b163-44da3182165b
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,864
supabase-export-v2
bf1935dd2e03f464
The class setting can be overridden in individual test methods by assigning an instance attribute, self.longMessage, to ``True`` or ``False`` before calling the assert methods. The class setting gets reset before each test call.
trusted_official_docs
CPython Docs
The class setting can be overridden in individual test methods by assigning an instance attribute, self.longMessage, to ``True`` or ``False`` before calling the assert methods. The class setting gets reset before each test call.
The class setting can be overridden in individual test methods by assigning an instance attribute, self.longMessage, to ``True`` or ``False`` before calling the assert methods. The class setting gets reset before each test call.
python, official-docs, cpython, P0
Local_Trusted_Corpus
9c119d43-a3a1-40a2-ab6e-3f46c07900b2
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,774
supabase-export-v2
50c69ebaf30e1c15
.. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds) assertWarnsRegex(warning, regex, *, msg=None) Like :meth:`assertWarns` but also tests that *regex* matches on the message of the triggered warning. *regex* may be a regular expression object or a string containing a regular expression suitable for ...
trusted_official_docs
CPython Docs
.. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds) assertWarnsRegex(warning, regex, *, msg=None) Like :meth:`assertWarns` but also tests that *regex* matches on the message of the triggered warning. *regex* may be a regular expression object or a string containing a regular expression suitable for ...
.. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds) assertWarnsRegex(warning, regex, *, msg=None) Like :meth:`assertWarns` but also tests that *regex* matches on the message of the triggered warning. *regex* may be a regular expression object or a string containing a regular expression suitable for ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
9c65efde-cd6b-498b-ae24-d7f009ba3f39
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,818
supabase-export-v2
4faa43f9b4ee6e32
part of *text* that unexpectedly matched). *regex* may be a regular expression object or a string containing a regular expression suitable for use by :func:`re.search`. .. versionadded:: 3.1 Added under the name ``assertRegexpMatches``. .. versionchanged:: 3.2 The method ``assertRegexpMatches()`` has been renamed to ...
trusted_official_docs
CPython Docs
part of *text* that unexpectedly matched). *regex* may be a regular expression object or a string containing a regular expression suitable for use by :func:`re.search`. .. versionadded:: 3.1 Added under the name ``assertRegexpMatches``. .. versionchanged:: 3.2 The method ``assertRegexpMatches()`` has been renamed to ...
part of *text* that unexpectedly matched). *regex* may be a regular expression object or a string containing a regular expression suitable for use by :func:`re.search`. .. versionadded:: 3.1 Added under the name ``assertRegexpMatches``. .. versionchanged:: 3.2 The method ``assertRegexpMatches()`` has been renamed to ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
9d38a39f-333b-4726-854a-b3a6ec520d4c
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,837
supabase-export-v2
dc9d9559361e195e
list of type-specific methods automatically used by :meth:`~TestCase.assertEqual` are summarized in the following table. Note that it's usually not necessary to invoke these methods directly. +-----------------------------------------+-----------------------------+--------------+ | Method | Used to compare | New in | ...
trusted_official_docs
CPython Docs
list of type-specific methods automatically used by :meth:`~TestCase.assertEqual` are summarized in the following table. Note that it's usually not necessary to invoke these methods directly. +-----------------------------------------+-----------------------------+--------------+ | Method | Used to compare | New in | ...
list of type-specific methods automatically used by :meth:`~TestCase.assertEqual` are summarized in the following table. Note that it's usually not necessary to invoke these methods directly. +-----------------------------------------+-----------------------------+--------------+ | Method | Used to compare | New in | ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
9e74b8b7-2c1c-44a9-91df-e922a9639b85
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,996
supabase-export-v2
df6e645f2395cddf
*start_dir* can be a :term:`namespace packages <namespace package>`. Paths are sorted before being imported so that execution order is the same even if the underlying file system's ordering is not dependent on file name.
trusted_official_docs
CPython Docs
*start_dir* can be a :term:`namespace packages <namespace package>`. Paths are sorted before being imported so that execution order is the same even if the underlying file system's ordering is not dependent on file name.
*start_dir* can be a :term:`namespace packages <namespace package>`. Paths are sorted before being imported so that execution order is the same even if the underlying file system's ordering is not dependent on file name.
python, official-docs, cpython, P0
Local_Trusted_Corpus
a0c969a4-3800-4e96-9b7a-495bb42b9ecd
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,574
supabase-export-v2
a01cea70df609554
test files from the start directory you specify it turns the paths into package names to import. For example :file:`foo/bar/baz.py` will be imported as ``foo.bar.baz``. If you have a package installed globally and attempt test discovery on a different copy of the package then the import *could* happen from the wrong ...
trusted_official_docs
CPython Docs
test files from the start directory you specify it turns the paths into package names to import. For example :file:`foo/bar/baz.py` will be imported as ``foo.bar.baz``. If you have a package installed globally and attempt test discovery on a different copy of the package then the import *could* happen from the wrong ...
test files from the start directory you specify it turns the paths into package names to import. For example :file:`foo/bar/baz.py` will be imported as ``foo.bar.baz``. If you have a package installed globally and attempt test discovery on a different copy of the package then the import *could* happen from the wrong ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
a1c29c94-a435-4cd4-92f1-3d7399ec4426
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,152
supabase-export-v2
3ebc20624d40700b
If you want the ``setUpClass`` and ``tearDownClass`` on base classes called then you must call up to them yourself. The implementations in :class:`TestCase` are empty. If an exception is raised during a ``setUpClass`` then the tests in the class are not run and the ``tearDownClass`` is not run. Skipped classes will not...
trusted_official_docs
CPython Docs
If you want the ``setUpClass`` and ``tearDownClass`` on base classes called then you must call up to them yourself. The implementations in :class:`TestCase` are empty. If an exception is raised during a ``setUpClass`` then the tests in the class are not run and the ``tearDownClass`` is not run. Skipped classes will not...
If you want the ``setUpClass`` and ``tearDownClass`` on base classes called then you must call up to them yourself. The implementations in :class:`TestCase` are empty. If an exception is raised during a ``setUpClass`` then the tests in the class are not run and the ``tearDownClass`` is not run. Skipped classes will not...
python, official-docs, cpython, P0
Local_Trusted_Corpus
a1d4ea88-273e-4e28-b0d1-b23c41d238f7
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,761
supabase-export-v2
2ce68c59bcdc4836
isn't. Any exception is an error. To catch any of a group of warnings, a tuple containing the warning classes may be passed as *warnings*. If only the *warning* and possibly the *msg* arguments are given, return a context manager so that the code under test can be written inline rather than as a function::
trusted_official_docs
CPython Docs
isn't. Any exception is an error. To catch any of a group of warnings, a tuple containing the warning classes may be passed as *warnings*. If only the *warning* and possibly the *msg* arguments are given, return a context manager so that the code under test can be written inline rather than as a function::
isn't. Any exception is an error. To catch any of a group of warnings, a tuple containing the warning classes may be passed as *warnings*. If only the *warning* and possibly the *msg* arguments are given, return a context manager so that the code under test can be written inline rather than as a function::
python, official-docs, cpython, P0
Local_Trusted_Corpus
a1e1dd59-66c1-46ba-83cc-11104a7ca449
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
41,987
supabase-export-v2
f3b58ee2185b3446
be importable from the top level of the project. If the start directory is not the top level directory then *top_level_dir* must be specified separately. If importing a module fails, for example due to a syntax error, then this will be recorded as a single error and discovery will continue. If the import failure is d...
trusted_official_docs
CPython Docs
be importable from the top level of the project. If the start directory is not the top level directory then *top_level_dir* must be specified separately. If importing a module fails, for example due to a syntax error, then this will be recorded as a single error and discovery will continue. If the import failure is d...
be importable from the top level of the project. If the start directory is not the top level directory then *top_level_dir* must be specified separately. If importing a module fails, for example due to a syntax error, then this will be recorded as a single error and discovery will continue. If the import failure is d...
python, official-docs, cpython, P0
Local_Trusted_Corpus
a3b08112-68a2-4d3c-8568-12779edaafe3
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,105
supabase-export-v2
b4ae157e565b0bdf
for making test modules conveniently executable. The simplest use for this function is to include the following line at the end of a test script:: if __name__ == '__main__': unittest.main()
trusted_official_docs
CPython Docs
for making test modules conveniently executable. The simplest use for this function is to include the following line at the end of a test script:: if __name__ == '__main__': unittest.main()
for making test modules conveniently executable. The simplest use for this function is to include the following line at the end of a test script:: if __name__ == '__main__': unittest.main()
python, official-docs, cpython, P0
Local_Trusted_Corpus
a5f06960-301a-4c13-b3c1-f440781d17cf
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,092
supabase-export-v2
a6fbbb347bba610d
run test suites should provide alternate implementations. Such implementations should accept ``**kwargs`` as the interface to construct runners changes when features are added to unittest. By default this runner shows :exc:`DeprecationWarning`, :exc:`PendingDeprecationWarning`, :exc:`ResourceWarning` and :exc:`Import...
trusted_official_docs
CPython Docs
run test suites should provide alternate implementations. Such implementations should accept ``**kwargs`` as the interface to construct runners changes when features are added to unittest. By default this runner shows :exc:`DeprecationWarning`, :exc:`PendingDeprecationWarning`, :exc:`ResourceWarning` and :exc:`Import...
run test suites should provide alternate implementations. Such implementations should accept ``**kwargs`` as the interface to construct runners changes when features are added to unittest. By default this runner shows :exc:`DeprecationWarning`, :exc:`PendingDeprecationWarning`, :exc:`ResourceWarning` and :exc:`Import...
python, official-docs, cpython, P0
Local_Trusted_Corpus
a6834cbb-1a14-4629-8175-71350f965780
CPython Docs
file://datasets/cpython/Doc/library/unittest.rst
unknown
9631c318-9739-45cd-9e68-6c9a3439030e
42,110
supabase-export-v2
e171840d0df63aa4
of options passed to the program, with the first element being the program name. If not specified or ``None``, the values of :data:`sys.argv` are used. The *testRunner* argument can either be a test runner class or an already created instance of it. By default ``main`` calls :func:`sys.exit` with an exit code indicat...
trusted_official_docs
CPython Docs
of options passed to the program, with the first element being the program name. If not specified or ``None``, the values of :data:`sys.argv` are used. The *testRunner* argument can either be a test runner class or an already created instance of it. By default ``main`` calls :func:`sys.exit` with an exit code indicat...
of options passed to the program, with the first element being the program name. If not specified or ``None``, the values of :data:`sys.argv` are used. The *testRunner* argument can either be a test runner class or an already created instance of it. By default ``main`` calls :func:`sys.exit` with an exit code indicat...
python, official-docs, cpython, P0
Local_Trusted_Corpus