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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3cc2f51c-62bf-4098-806a-1e51265ce2f7 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,037 | supabase-export-v2 | bfba56a61e473d7e | If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a fresh environment.
Python is started in isolated mode (command line option ``-I``),
except if the *__isolated* keyword-only parameter is set to ``False``. | trusted_official_docs | CPython Docs | If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a fresh environment.
Python is started in isolated mode (command line option ``-I``),
except if the *__isolated* keyword-only parameter is set to ``False``. | If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a fresh environment.
Python is started in isolated mode (command line option ``-I``),
except if the *__isolated* keyword-only parameter is set to ``False``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3f6464e7-0888-469a-a055-6726c9566804 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,973 | supabase-export-v2 | afc0c1f7228fcd30 | One case for this is when *module* imports part of its public API from other modules, possibly a C backend (like ``csv`` and its ``_csv``).
The *extra* argument can be a set of names that wouldn't otherwise be automatically
detected as "public", like objects without a proper :attr:`~definition.__module__`
attribute. ... | trusted_official_docs | CPython Docs | One case for this is when *module* imports part of its public API from other modules, possibly a C backend (like ``csv`` and its ``_csv``).
The *extra* argument can be a set of names that wouldn't otherwise be automatically
detected as "public", like objects without a proper :attr:`~definition.__module__`
attribute. ... | One case for this is when *module* imports part of its public API from other modules, possibly a C backend (like ``csv`` and its ``_csv``).
The *extra* argument can be a set of names that wouldn't otherwise be automatically
detected as "public", like objects without a proper :attr:`~definition.__module__`
attribute. ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3fa12f6a-104d-4b56-a8ff-77a33f081f6c | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,104 | supabase-export-v2 | 3e26b4922ccb85f6 | .. data:: TESTFN
Set to a name that is safe to use as the name of a temporary file. Any
temporary file that is created should be closed and unlinked (removed). | trusted_official_docs | CPython Docs | .. data:: TESTFN
Set to a name that is safe to use as the name of a temporary file. Any
temporary file that is created should be closed and unlinked (removed). | .. data:: TESTFN
Set to a name that is safe to use as the name of a temporary file. Any
temporary file that is created should be closed and unlinked (removed). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
42e3ad4b-eee8-40c3-8ecd-78fe06bd054f | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,710 | supabase-export-v2 | 1de10147cee64c57 | can run :program:`make test` at the top-level directory where Python was built. On Windows, executing :program:`rt.bat` from your :file:`PCbuild` directory will run all regression tests.
.. versionadded:: 3.14
Output is colorized by default and can be
:ref:`controlled using environment variables <using-on-controlling... | trusted_official_docs | CPython Docs | can run :program:`make test` at the top-level directory where Python was built. On Windows, executing :program:`rt.bat` from your :file:`PCbuild` directory will run all regression tests.
.. versionadded:: 3.14
Output is colorized by default and can be
:ref:`controlled using environment variables <using-on-controlling... | can run :program:`make test` at the top-level directory where Python was built. On Windows, executing :program:`rt.bat` from your :file:`PCbuild` directory will run all regression tests.
.. versionadded:: 3.14
Output is colorized by default and can be
:ref:`controlled using environment variables <using-on-controlling... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
46e48007-73fb-42e8-b52c-815060e5b1ac | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,707 | supabase-export-v2 | 5fc2bfaa0f283611 | .. module:: test.regrtest :synopsis: Drives the regression test suite.
The :mod:`!test` package can be run as a script to drive Python's regression
test suite, thanks to the :option:`-m` option: :program:`python -m test`. Under
the hood, it uses :mod:`!test.regrtest`; the call :program:`python -m
test.regrtest` used in... | trusted_official_docs | CPython Docs | .. module:: test.regrtest :synopsis: Drives the regression test suite.
The :mod:`!test` package can be run as a script to drive Python's regression
test suite, thanks to the :option:`-m` option: :program:`python -m test`. Under
the hood, it uses :mod:`!test.regrtest`; the call :program:`python -m
test.regrtest` used in... | .. module:: test.regrtest :synopsis: Drives the regression test suite.
The :mod:`!test` package can be run as a script to drive Python's regression
test suite, thanks to the :option:`-m` option: :program:`python -m test`. Under
the hood, it uses :mod:`!test.regrtest`; the call :program:`python -m
test.regrtest` used in... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
48ac710e-8cb0-4ca6-9811-17822b8b1838 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,687 | supabase-export-v2 | 9fdad632fb251bb8 | all classes, functions, and constants. This includes not just the external API that is to be presented to the outside world but also "private" code.
* Whitebox testing (examining the code being tested when the tests are being
written) is preferred. Blackbox testing (testing only the published user
interface) is not c... | trusted_official_docs | CPython Docs | all classes, functions, and constants. This includes not just the external API that is to be presented to the outside world but also "private" code.
* Whitebox testing (examining the code being tested when the tests are being
written) is preferred. Blackbox testing (testing only the published user
interface) is not c... | all classes, functions, and constants. This includes not just the external API that is to be presented to the outside world but also "private" code.
* Whitebox testing (examining the code being tested when the tests are being
written) is preferred. Blackbox testing (testing only the published user
interface) is not c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
48ca7e3f-b593-490c-b207-a1b27a5d9c1b | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,746 | supabase-export-v2 | 2fcb5b7f1bd7a29f | Timeout in seconds for network requests going to the internet.
The timeout is short enough to prevent a test to wait for too long if the
internet request is blocked for whatever reason. | trusted_official_docs | CPython Docs | Timeout in seconds for network requests going to the internet.
The timeout is short enough to prevent a test to wait for too long if the
internet request is blocked for whatever reason. | Timeout in seconds for network requests going to the internet.
The timeout is short enough to prevent a test to wait for too long if the
internet request is blocked for whatever reason. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4a6b0d31-e86c-40b9-a5b7-47d6fa9252f1 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,202 | supabase-export-v2 | 5b08ae827b69ceeb | Context manager to check that no :exc:`ResourceWarning` was raised. You must remove the object which may emit :exc:`ResourceWarning` before the end of the context manager.
.. function:: check_syntax_warning(testcase, statement, errtext='', *, lineno=1, offset=None) | trusted_official_docs | CPython Docs | Context manager to check that no :exc:`ResourceWarning` was raised. You must remove the object which may emit :exc:`ResourceWarning` before the end of the context manager.
.. function:: check_syntax_warning(testcase, statement, errtext='', *, lineno=1, offset=None) | Context manager to check that no :exc:`ResourceWarning` was raised. You must remove the object which may emit :exc:`ResourceWarning` before the end of the context manager.
.. function:: check_syntax_warning(testcase, statement, errtext='', *, lineno=1, offset=None) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4a813ff7-2716-49e0-a5a5-d454a1278141 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,114 | supabase-export-v2 | f06d16c957578171 | .. class:: EnvironmentVarGuard()
Class used to temporarily set or unset environment variables. Instances can
be used as a context manager and have a complete dictionary interface for
querying/modifying the underlying ``os.environ``. After exit from the
context manager all changes to environment variables done throug... | trusted_official_docs | CPython Docs | .. class:: EnvironmentVarGuard()
Class used to temporarily set or unset environment variables. Instances can
be used as a context manager and have a complete dictionary interface for
querying/modifying the underlying ``os.environ``. After exit from the
context manager all changes to environment variables done throug... | .. class:: EnvironmentVarGuard()
Class used to temporarily set or unset environment variables. Instances can
be used as a context manager and have a complete dictionary interface for
querying/modifying the underlying ``os.environ``. After exit from the
context manager all changes to environment variables done throug... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4af3a003-9f25-46be-8b27-dce2eadd818f | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,165 | supabase-export-v2 | ca4e6cd2455ceaa8 | module by removing the named module from ``sys.modules`` before doing the import. Note that unlike :func:`reload`, the original module is not affected by this operation.
*fresh* is an iterable of additional module names that are also removed
from the ``sys.modules`` cache before doing the import. | trusted_official_docs | CPython Docs | module by removing the named module from ``sys.modules`` before doing the import. Note that unlike :func:`reload`, the original module is not affected by this operation.
*fresh* is an iterable of additional module names that are also removed
from the ``sys.modules`` cache before doing the import. | module by removing the named module from ``sys.modules`` before doing the import. Note that unlike :func:`reload`, the original module is not affected by this operation.
*fresh* is an iterable of additional module names that are also removed
from the ``sys.modules`` cache before doing the import. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4b8a2c48-f9d9-440b-b57a-d50d1bf989ee | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,215 | supabase-export-v2 | 39ac1a006e3fe95c | with check_warnings(("assertion is always true", SyntaxWarning), ("", UserWarning)): exec('assert(False, "Hey!")') warnings.warn(UserWarning("Hide me!"))
In this case if either warning was not raised, or some other warning was
raised, :func:`check_warnings` would raise an error. | trusted_official_docs | CPython Docs | with check_warnings(("assertion is always true", SyntaxWarning), ("", UserWarning)): exec('assert(False, "Hey!")') warnings.warn(UserWarning("Hide me!"))
In this case if either warning was not raised, or some other warning was
raised, :func:`check_warnings` would raise an error. | with check_warnings(("assertion is always true", SyntaxWarning), ("", UserWarning)): exec('assert(False, "Hey!")') warnings.warn(UserWarning("Hide me!"))
In this case if either warning was not raised, or some other warning was
raised, :func:`check_warnings` would raise an error. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
506aa57c-6b91-45a0-9381-67b209c75a31 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,928 | supabase-export-v2 | 73dfa4ff1eb5ea27 | is not run by CPython. Any trace function is unset for the duration of the test to prevent unexpected refcounts caused by the trace function.
.. decorator:: bigmemtest(size, memuse, dry_run=True) | trusted_official_docs | CPython Docs | is not run by CPython. Any trace function is unset for the duration of the test to prevent unexpected refcounts caused by the trace function.
.. decorator:: bigmemtest(size, memuse, dry_run=True) | is not run by CPython. Any trace function is unset for the duration of the test to prevent unexpected refcounts caused by the trace function.
.. decorator:: bigmemtest(size, memuse, dry_run=True) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5107ff89-4d8c-48c1-ac28-0b5ea006c3e6 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,701 | supabase-export-v2 | de90e025c639d510 | class AcceptTuples(TestFuncAcceptsSequencesMixin, unittest.TestCase): arg = (1, 2, 3)
When using this pattern, remember that all classes that inherit from
:class:`unittest.TestCase` are run as tests. The :class:`!TestFuncAcceptsSequencesMixin` class in the example above
does not have any data and so can't be run by i... | trusted_official_docs | CPython Docs | class AcceptTuples(TestFuncAcceptsSequencesMixin, unittest.TestCase): arg = (1, 2, 3)
When using this pattern, remember that all classes that inherit from
:class:`unittest.TestCase` are run as tests. The :class:`!TestFuncAcceptsSequencesMixin` class in the example above
does not have any data and so can't be run by i... | class AcceptTuples(TestFuncAcceptsSequencesMixin, unittest.TestCase): arg = (1, 2, 3)
When using this pattern, remember that all classes that inherit from
:class:`unittest.TestCase` are run as tests. The :class:`!TestFuncAcceptsSequencesMixin` class in the example above
does not have any data and so can't be run by i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5310b4e4-9eee-461b-8a77-46aea6224bf8 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,217 | supabase-export-v2 | 2b793f150dd7ca57 | a test needs to look more deeply into the warnings, rather than just checking whether or not they occurred, code like this can be used::
with check_warnings(quiet=True) as w:
warnings.warn("foo")
assert str(w.args[0]) == "foo"
warnings.warn("bar")
assert str(w.args[0]) == "bar"
assert str(w.warnings[0].args[0]) ==... | trusted_official_docs | CPython Docs | a test needs to look more deeply into the warnings, rather than just checking whether or not they occurred, code like this can be used::
with check_warnings(quiet=True) as w:
warnings.warn("foo")
assert str(w.args[0]) == "foo"
warnings.warn("bar")
assert str(w.args[0]) == "bar"
assert str(w.warnings[0].args[0]) ==... | a test needs to look more deeply into the warnings, rather than just checking whether or not they occurred, code like this can be used::
with check_warnings(quiet=True) as w:
warnings.warn("foo")
assert str(w.args[0]) == "foo"
warnings.warn("bar")
assert str(w.args[0]) == "bar"
assert str(w.warnings[0].args[0]) ==... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5367d90b-2468-42f5-8eff-076a5a4e2f99 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,834 | supabase-export-v2 | ef0ce3e82b5f6ca9 | or to run them only on the implementations guarded by the arguments. This function returns ``True`` or ``False`` depending on the host platform. Example usage::
check_impl_detail() # Only on CPython (default). check_impl_detail(jython=True) # Only on Jython. check_impl_detail(cpython=False) # Everywhere except CPython. | trusted_official_docs | CPython Docs | or to run them only on the implementations guarded by the arguments. This function returns ``True`` or ``False`` depending on the host platform. Example usage::
check_impl_detail() # Only on CPython (default). check_impl_detail(jython=True) # Only on Jython. check_impl_detail(cpython=False) # Everywhere except CPython. | or to run them only on the implementations guarded by the arguments. This function returns ``True`` or ``False`` depending on the host platform. Example usage::
check_impl_detail() # Only on CPython (default). check_impl_detail(jython=True) # Only on Jython. check_impl_detail(cpython=False) # Everywhere except CPython. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5420b776-8f61-4437-88c9-a68809082481 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,821 | supabase-export-v2 | 4bea3779fdb4d116 | .. function:: requires(resource, msg=None)
Raise :exc:`ResourceDenied` if *resource* is not available. *msg* is the
argument to :exc:`ResourceDenied` if it is raised. Always returns
``True`` if called by a function whose ``__name__`` is ``'__main__'``. Used when tests are executed by :mod:`test.regrtest`. | trusted_official_docs | CPython Docs | .. function:: requires(resource, msg=None)
Raise :exc:`ResourceDenied` if *resource* is not available. *msg* is the
argument to :exc:`ResourceDenied` if it is raised. Always returns
``True`` if called by a function whose ``__name__`` is ``'__main__'``. Used when tests are executed by :mod:`test.regrtest`. | .. function:: requires(resource, msg=None)
Raise :exc:`ResourceDenied` if *resource* is not available. *msg* is the
argument to :exc:`ResourceDenied` if it is raised. Always returns
``True`` if called by a function whose ``__name__`` is ``'__main__'``. Used when tests are executed by :mod:`test.regrtest`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
552e2263-e2c1-4cb0-9e4d-c5a258751aa7 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,016 | supabase-export-v2 | a00575fee31b4485 | it. Tests should never set these socket options for TCP/IP sockets. The only case for setting these options is testing multicasting via multiple UDP sockets.
Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is
available (i.e. on Windows), it will be set on the socket. This will
prevent anyone e... | trusted_official_docs | CPython Docs | it. Tests should never set these socket options for TCP/IP sockets. The only case for setting these options is testing multicasting via multiple UDP sockets.
Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is
available (i.e. on Windows), it will be set on the socket. This will
prevent anyone e... | it. Tests should never set these socket options for TCP/IP sockets. The only case for setting these options is testing multicasting via multiple UDP sockets.
Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is
available (i.e. on Windows), it will be set on the socket. This will
prevent anyone e... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5775f2d7-3668-4cd1-832e-6eb8f21874d8 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,833 | supabase-export-v2 | e665718bb171b3cf | .. function:: check_impl_detail(**guards)
Use this check to guard CPython's implementation-specific tests or to
run them only on the implementations guarded by the arguments. This
function returns ``True`` or ``False`` depending on the host platform. Example usage:: | trusted_official_docs | CPython Docs | .. function:: check_impl_detail(**guards)
Use this check to guard CPython's implementation-specific tests or to
run them only on the implementations guarded by the arguments. This
function returns ``True`` or ``False`` depending on the host platform. Example usage:: | .. function:: check_impl_detail(**guards)
Use this check to guard CPython's implementation-specific tests or to
run them only on the implementations guarded by the arguments. This
function returns ``True`` or ``False`` depending on the host platform. Example usage:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
580f64cd-8e47-4ba4-bac3-d230189a9170 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,149 | supabase-export-v2 | ef6a3a90f73e9f1c | in the current directory with name *name* before temporarily changing the current working directory. If *name* is ``None``, the temporary directory is created using :func:`tempfile.mkdtemp`.
If *quiet* is ``False`` and it is not possible to create or change
the CWD, an error is raised. Otherwise, only a warning is rai... | trusted_official_docs | CPython Docs | in the current directory with name *name* before temporarily changing the current working directory. If *name* is ``None``, the temporary directory is created using :func:`tempfile.mkdtemp`.
If *quiet* is ``False`` and it is not possible to create or change
the CWD, an error is raised. Otherwise, only a warning is rai... | in the current directory with name *name* before temporarily changing the current working directory. If *name* is ``None``, the temporary directory is created using :func:`tempfile.mkdtemp`.
If *quiet* is ``False`` and it is not possible to create or change
the CWD, an error is raised. Otherwise, only a warning is rai... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5c212dcb-c743-4177-88eb-cf0aa5da79de | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,029 | supabase-export-v2 | 971b06a841f77316 | with ``@unittest.skipIf()`` to annotate tests that need to use an ``assert_python*()`` function to launch an isolated mode (``-I``) or no environment mode (``-E``) sub-interpreter process.
A normal build & test does not run into this situation but it can happen
when trying to run the standard library test suite from a... | trusted_official_docs | CPython Docs | with ``@unittest.skipIf()`` to annotate tests that need to use an ``assert_python*()`` function to launch an isolated mode (``-I``) or no environment mode (``-E``) sub-interpreter process.
A normal build & test does not run into this situation but it can happen
when trying to run the standard library test suite from a... | with ``@unittest.skipIf()`` to annotate tests that need to use an ``assert_python*()`` function to launch an isolated mode (``-I``) or no environment mode (``-E``) sub-interpreter process.
A normal build & test does not run into this situation but it can happen
when trying to run the standard library test suite from a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5c236ed0-2b9d-4c67-adac-eb5b0e327d56 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,108 | supabase-export-v2 | 6162e2235e348c3d | .. data:: TESTFN_UNENCODABLE
Set to a filename (str type) that should not be able to be encoded by file
system encoding in strict mode. It may be ``None`` if it's not possible to
generate such a filename. | trusted_official_docs | CPython Docs | .. data:: TESTFN_UNENCODABLE
Set to a filename (str type) that should not be able to be encoded by file
system encoding in strict mode. It may be ``None`` if it's not possible to
generate such a filename. | .. data:: TESTFN_UNENCODABLE
Set to a filename (str type) that should not be able to be encoded by file
system encoding in strict mode. It may be ``None`` if it's not possible to
generate such a filename. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5d238d97-6c5a-4620-9348-95fea4f5793b | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,186 | supabase-export-v2 | ce0ece77d621965d | .. class:: CleanImport(*module_names)
A context manager to force import to return a new module reference. This
is useful for testing module-level behaviors, such as the emission of a
:exc:`DeprecationWarning` on import. Example usage:: | trusted_official_docs | CPython Docs | .. class:: CleanImport(*module_names)
A context manager to force import to return a new module reference. This
is useful for testing module-level behaviors, such as the emission of a
:exc:`DeprecationWarning` on import. Example usage:: | .. class:: CleanImport(*module_names)
A context manager to force import to return a new module reference. This
is useful for testing module-level behaviors, such as the emission of a
:exc:`DeprecationWarning` on import. Example usage:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5d74a5b8-4bf1-41fe-b438-dc3110bacfaf | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,184 | supabase-export-v2 | 93d9541daf1a6fe1 | .. function:: make_legacy_pyc(source)
Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return the file
system path to the legacy pyc file. The *source* value is the file system
path to the source file. It does not need to exist, however the PEP
3147/488 pyc file must exist. | trusted_official_docs | CPython Docs | .. function:: make_legacy_pyc(source)
Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return the file
system path to the legacy pyc file. The *source* value is the file system
path to the source file. It does not need to exist, however the PEP
3147/488 pyc file must exist. | .. function:: make_legacy_pyc(source)
Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return the file
system path to the legacy pyc file. The *source* value is the file system
path to the source file. It does not need to exist, however the PEP
3147/488 pyc file must exist. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5e857d93-7c4a-4876-a410-94076ac7178c | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,152 | supabase-export-v2 | c2f40efb246d1cf9 | A context manager that creates a temporary directory at *path* and yields the directory.
If *path* is ``None``, the temporary directory is created using
:func:`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager
raises an exception on error. Otherwise, if *path* is specified and
cannot be created, only a... | trusted_official_docs | CPython Docs | A context manager that creates a temporary directory at *path* and yields the directory.
If *path* is ``None``, the temporary directory is created using
:func:`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager
raises an exception on error. Otherwise, if *path* is specified and
cannot be created, only a... | A context manager that creates a temporary directory at *path* and yields the directory.
If *path* is ``None``, the temporary directory is created using
:func:`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager
raises an exception on error. Otherwise, if *path* is specified and
cannot be created, only a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
60b42a5f-9037-41dc-8e78-468bfb5316c5 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,190 | supabase-export-v2 | 4b9d29e0e9756fae | A context manager to temporarily add directories to :data:`sys.path`.
This makes a copy of :data:`sys.path`, appends any directories given
as positional arguments, then reverts :data:`sys.path` to the copied
settings when the context ends. | trusted_official_docs | CPython Docs | A context manager to temporarily add directories to :data:`sys.path`.
This makes a copy of :data:`sys.path`, appends any directories given
as positional arguments, then reverts :data:`sys.path` to the copied
settings when the context ends. | A context manager to temporarily add directories to :data:`sys.path`.
This makes a copy of :data:`sys.path`, appends any directories given
as positional arguments, then reverts :data:`sys.path` to the copied
settings when the context ends. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6141db6d-a3b9-4fad-89e6-bd2fa9328bd6 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,969 | supabase-export-v2 | 6e08f536c1250d59 | listed in *cmd_names* or all the compiler executables when *cmd_names* is empty and return the first missing executable or ``None`` when none is found missing.
.. function:: check__all__(test_case, module, name_of_module=None, extra=(), not_exported=()) | trusted_official_docs | CPython Docs | listed in *cmd_names* or all the compiler executables when *cmd_names* is empty and return the first missing executable or ``None`` when none is found missing.
.. function:: check__all__(test_case, module, name_of_module=None, extra=(), not_exported=()) | listed in *cmd_names* or all the compiler executables when *cmd_names* is empty and return the first missing executable or ``None`` when none is found missing.
.. function:: check__all__(test_case, module, name_of_module=None, extra=(), not_exported=()) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
61809ea3-24c8-44df-9ea9-090b0f5c8374 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,216 | supabase-export-v2 | 480989202d484db9 | In this case if either warning was not raised, or some other warning was raised, :func:`check_warnings` would raise an error.
When a test needs to look more deeply into the warnings, rather than
just checking whether or not they occurred, code like this can be used:: | trusted_official_docs | CPython Docs | In this case if either warning was not raised, or some other warning was raised, :func:`check_warnings` would raise an error.
When a test needs to look more deeply into the warnings, rather than
just checking whether or not they occurred, code like this can be used:: | In this case if either warning was not raised, or some other warning was raised, :func:`check_warnings` would raise an error.
When a test needs to look more deeply into the warnings, rather than
just checking whether or not they occurred, code like this can be used:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
62c9f0e1-5ad0-45b8-80b1-c8e2dff6edd3 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,684 | supabase-export-v2 | 6f9df3ba1f30653e | if __name__ == '__main__': unittest.main()
This code pattern allows the testing suite to be run by :mod:`test.regrtest`,
on its own as a script that supports the :mod:`unittest` CLI, or via the
``python -m unittest`` CLI. | trusted_official_docs | CPython Docs | if __name__ == '__main__': unittest.main()
This code pattern allows the testing suite to be run by :mod:`test.regrtest`,
on its own as a script that supports the :mod:`unittest` CLI, or via the
``python -m unittest`` CLI. | if __name__ == '__main__': unittest.main()
This code pattern allows the testing suite to be run by :mod:`test.regrtest`,
on its own as a script that supports the :mod:`unittest` CLI, or via the
``python -m unittest`` CLI. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
646edb21-57b8-4675-81a6-9a2dcbfc9fc2 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,211 | supabase-export-v2 | c6d93254f1b815fe | In this case all warnings are caught and no errors are raised.
On entry to the context manager, a :class:`WarningRecorder` instance is
returned. The underlying warnings list from
:func:`~warnings.catch_warnings` is available via the recorder object's
:attr:`warnings` attribute. As a convenience, the attributes of th... | trusted_official_docs | CPython Docs | In this case all warnings are caught and no errors are raised.
On entry to the context manager, a :class:`WarningRecorder` instance is
returned. The underlying warnings list from
:func:`~warnings.catch_warnings` is available via the recorder object's
:attr:`warnings` attribute. As a convenience, the attributes of th... | In this case all warnings are caught and no errors are raised.
On entry to the context manager, a :class:`WarningRecorder` instance is
returned. The underlying warnings list from
:func:`~warnings.catch_warnings` is available via the recorder object's
:attr:`warnings` attribute. As a convenience, the attributes of th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6686816d-bdef-4e9b-b0fa-0f32abc2a7f1 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,167 | supabase-export-v2 | c6644ba1448927a7 | iterable of module names that are replaced with ``None`` in the module cache during the import to ensure that attempts to import them raise :exc:`ImportError`.
The named module and any modules named in the *fresh* and *blocked*
parameters are saved before starting the import and then reinserted into
``sys.modules`` w... | trusted_official_docs | CPython Docs | iterable of module names that are replaced with ``None`` in the module cache during the import to ensure that attempts to import them raise :exc:`ImportError`.
The named module and any modules named in the *fresh* and *blocked*
parameters are saved before starting the import and then reinserted into
``sys.modules`` w... | iterable of module names that are replaced with ``None`` in the module cache during the import to ensure that attempts to import them raise :exc:`ImportError`.
The named module and any modules named in the *fresh* and *blocked*
parameters are saved before starting the import and then reinserted into
``sys.modules`` w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
67d0f2e7-97ed-44bb-8f9e-882ab36067bb | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,867 | supabase-export-v2 | 733df2fd526c9d72 | with swap_item(obj, "item", 5): ...
This will set ``obj["item"]`` to 5 for the duration of the ``with`` block,
restoring the old value at the end of the block. If ``item`` doesn't
exist on ``obj``, it will be created and then deleted at the end of the
block. | trusted_official_docs | CPython Docs | with swap_item(obj, "item", 5): ...
This will set ``obj["item"]`` to 5 for the duration of the ``with`` block,
restoring the old value at the end of the block. If ``item`` doesn't
exist on ``obj``, it will be created and then deleted at the end of the
block. | with swap_item(obj, "item", 5): ...
This will set ``obj["item"]`` to 5 for the duration of the ``with`` block,
restoring the old value at the end of the block. If ``item`` doesn't
exist on ``obj``, it will be created and then deleted at the end of the
block. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6825be8d-13f6-48a4-8186-e665980a91c1 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,662 | supabase-export-v2 | 10d6bd305f8e158f | .. module:: test :synopsis: Regression tests package containing the testing suite for Python.
.. note::
The :mod:`!test` package is meant for internal use by Python only. It is
documented for the benefit of the core developers of Python. Any use of
this package outside of Python's standard library is discouraged as ... | trusted_official_docs | CPython Docs | .. module:: test :synopsis: Regression tests package containing the testing suite for Python.
.. note::
The :mod:`!test` package is meant for internal use by Python only. It is
documented for the benefit of the core developers of Python. Any use of
this package outside of Python's standard library is discouraged as ... | .. module:: test :synopsis: Regression tests package containing the testing suite for Python.
.. note::
The :mod:`!test` package is meant for internal use by Python only. It is
documented for the benefit of the core developers of Python. Any use of
this package outside of Python's standard library is discouraged as ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6b1428ca-9d5c-4fdd-a733-f2656848465f | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,959 | supabase-export-v2 | c9cf54804670ac94 | functions or methods of *ref_api* not found on *other_api*, except for a defined list of items to be ignored in this check specified in *ignore*.
By default this skips private attributes beginning with '_' but
includes all magic methods, i.e. those starting and ending in '__'. | trusted_official_docs | CPython Docs | functions or methods of *ref_api* not found on *other_api*, except for a defined list of items to be ignored in this check specified in *ignore*.
By default this skips private attributes beginning with '_' but
includes all magic methods, i.e. those starting and ending in '__'. | functions or methods of *ref_api* not found on *other_api*, except for a defined list of items to be ignored in this check specified in *ignore*.
By default this skips private attributes beginning with '_' but
includes all magic methods, i.e. those starting and ending in '__'. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
74c43f9d-bb2b-445b-ab8f-ff2f6e45f010 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,141 | supabase-export-v2 | 5fb3eab270bc100c | .. function:: rmtree(path)
Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and
:func:`os.rmdir` to remove a path and its contents. As with :func:`rmdir`,
on Windows platforms
this is wrapped with a wait loop that checks for the existence of the files. | trusted_official_docs | CPython Docs | .. function:: rmtree(path)
Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and
:func:`os.rmdir` to remove a path and its contents. As with :func:`rmdir`,
on Windows platforms
this is wrapped with a wait loop that checks for the existence of the files. | .. function:: rmtree(path)
Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and
:func:`os.rmdir` to remove a path and its contents. As with :func:`rmdir`,
on Windows platforms
this is wrapped with a wait loop that checks for the existence of the files. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
778fdc58-32f2-4505-b682-7ac3ebe66417 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,992 | supabase-export-v2 | a5d90a064c35909a | A context manager used to try to prevent crash dialog popups on tests that are expected to crash a subprocess.
On Windows, it disables Windows Error Reporting dialogs using
`SetErrorMode <https://msdn.microsoft.com/en-us/library/windows/desktop/ms680621.aspx>`_. | trusted_official_docs | CPython Docs | A context manager used to try to prevent crash dialog popups on tests that are expected to crash a subprocess.
On Windows, it disables Windows Error Reporting dialogs using
`SetErrorMode <https://msdn.microsoft.com/en-us/library/windows/desktop/ms680621.aspx>`_. | A context manager used to try to prevent crash dialog popups on tests that are expected to crash a subprocess.
On Windows, it disables Windows Error Reporting dialogs using
`SetErrorMode <https://msdn.microsoft.com/en-us/library/windows/desktop/ms680621.aspx>`_. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7a342b0f-a16b-4e2d-a0a9-0446fab76b78 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,012 | supabase-export-v2 | ca13173c83088e51 | .. function:: find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM)
Returns an unused port that should be suitable for binding. This is
achieved by creating a temporary socket with the same family and type as
the ``sock`` parameter (default is :const:`~socket.AF_INET`,
:const:`~socket.SOCK_STREAM`),
... | trusted_official_docs | CPython Docs | .. function:: find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM)
Returns an unused port that should be suitable for binding. This is
achieved by creating a temporary socket with the same family and type as
the ``sock`` parameter (default is :const:`~socket.AF_INET`,
:const:`~socket.SOCK_STREAM`),
... | .. function:: find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM)
Returns an unused port that should be suitable for binding. This is
achieved by creating a temporary socket with the same family and type as
the ``sock`` parameter (default is :const:`~socket.AF_INET`,
:const:`~socket.SOCK_STREAM`),
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7ce35ce3-d630-448a-8a8f-4032f1d25058 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,691 | supabase-export-v2 | b7e130e05f79bba8 | discovered for the tested code. This will make sure that the error does not crop up again if the code is changed in the future.
* Make sure to clean up after your tests (such as close and remove all temporary
files). | trusted_official_docs | CPython Docs | discovered for the tested code. This will make sure that the error does not crop up again if the code is changed in the future.
* Make sure to clean up after your tests (such as close and remove all temporary
files). | discovered for the tested code. This will make sure that the error does not crop up again if the code is changed in the future.
* Make sure to clean up after your tests (such as close and remove all temporary
files). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7ce39c61-b8ba-4c59-b417-991c3973b2e8 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,954 | supabase-export-v2 | b7cb47a2fc19fd97 | .. function:: load_package_tests(pkg_dir, loader, standard_tests, pattern)
Generic implementation of the :mod:`unittest` ``load_tests`` protocol for
use in test packages. *pkg_dir* is the root directory of the package;
*loader*, *standard_tests*, and *pattern* are the arguments expected by
``load_tests``. In simple ... | trusted_official_docs | CPython Docs | .. function:: load_package_tests(pkg_dir, loader, standard_tests, pattern)
Generic implementation of the :mod:`unittest` ``load_tests`` protocol for
use in test packages. *pkg_dir* is the root directory of the package;
*loader*, *standard_tests*, and *pattern* are the arguments expected by
``load_tests``. In simple ... | .. function:: load_package_tests(pkg_dir, loader, standard_tests, pattern)
Generic implementation of the :mod:`unittest` ``load_tests`` protocol for
use in test packages. *pkg_dir* is the root directory of the package;
*loader*, *standard_tests*, and *pattern* are the arguments expected by
``load_tests``. In simple ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7df89f8f-a78e-476f-9419-c9ebcb2f4509 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,740 | supabase-export-v2 | 8994902d5d15cafb | Timeout in seconds for tests using a network server listening on the network local loopback interface like ``127.0.0.1``.
The timeout is long enough to prevent test failure: it takes into account
that the client and the server can run in different threads or even
different processes. | trusted_official_docs | CPython Docs | Timeout in seconds for tests using a network server listening on the network local loopback interface like ``127.0.0.1``.
The timeout is long enough to prevent test failure: it takes into account
that the client and the server can run in different threads or even
different processes. | Timeout in seconds for tests using a network server listening on the network local loopback interface like ``127.0.0.1``.
The timeout is long enough to prevent test failure: it takes into account
that the client and the server can run in different threads or even
different processes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
80dee750-3a67-4875-b031-b80ec543310e | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,873 | supabase-export-v2 | 66e83d1ed681228b | .. function:: print_warning(msg)
Print a warning into :data:`sys.__stderr__`. Format the message as:
``f"Warning -- {msg}"``. If *msg* is made of multiple lines, add
``"Warning -- "`` prefix to each line. | trusted_official_docs | CPython Docs | .. function:: print_warning(msg)
Print a warning into :data:`sys.__stderr__`. Format the message as:
``f"Warning -- {msg}"``. If *msg* is made of multiple lines, add
``"Warning -- "`` prefix to each line. | .. function:: print_warning(msg)
Print a warning into :data:`sys.__stderr__`. Format the message as:
``f"Warning -- {msg}"``. If *msg* is made of multiple lines, add
``"Warning -- "`` prefix to each line. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
84fd534f-0619-4dde-b4c6-557d4181b900 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,716 | supabase-export-v2 | 617b2b3592c2f096 | It is documented here to help Python developers write tests. The API of this module is subject to change without backwards compatibility concerns between releases.
This module defines the following exceptions: | trusted_official_docs | CPython Docs | It is documented here to help Python developers write tests. The API of this module is subject to change without backwards compatibility concerns between releases.
This module defines the following exceptions: | It is documented here to help Python developers write tests. The API of this module is subject to change without backwards compatibility concerns between releases.
This module defines the following exceptions: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
877c597f-fc20-471d-906f-aa21e634eb36 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,807 | supabase-export-v2 | b3d9817f8db24fba | the loop. Sleep at each loop iteration, but not at the first iteration. The sleep delay is doubled at each iteration (up to *max_delay* seconds).
See :func:`busy_retry` documentation for the parameters usage. | trusted_official_docs | CPython Docs | the loop. Sleep at each loop iteration, but not at the first iteration. The sleep delay is doubled at each iteration (up to *max_delay* seconds).
See :func:`busy_retry` documentation for the parameters usage. | the loop. Sleep at each loop iteration, but not at the first iteration. The sleep delay is doubled at each iteration (up to *max_delay* seconds).
See :func:`busy_retry` documentation for the parameters usage. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
898a7cd1-6576-41ac-bf6f-dc49d124220c | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,129 | supabase-export-v2 | 7b6108314584a47c | A context manager that temporarily changes the current working directory to *path* and yields the directory.
If *quiet* is ``False``, the context manager raises an exception
on error. Otherwise, it issues only a warning and keeps the current
working directory the same. | trusted_official_docs | CPython Docs | A context manager that temporarily changes the current working directory to *path* and yields the directory.
If *quiet* is ``False``, the context manager raises an exception
on error. Otherwise, it issues only a warning and keeps the current
working directory the same. | A context manager that temporarily changes the current working directory to *path* and yields the directory.
If *quiet* is ``False``, the context manager raises an exception
on error. Otherwise, it issues only a warning and keeps the current
working directory the same. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8b798708-8076-4d7f-be87-b8a2edf46451 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,715 | supabase-export-v2 | 2205a48d7d5dab49 | .. note::
:mod:`!test.support` is not a public module. It is documented here to help
Python developers write tests. The API of this module is subject to change
without backwards compatibility concerns between releases. | trusted_official_docs | CPython Docs | .. note::
:mod:`!test.support` is not a public module. It is documented here to help
Python developers write tests. The API of this module is subject to change
without backwards compatibility concerns between releases. | .. note::
:mod:`!test.support` is not a public module. It is documented here to help
Python developers write tests. The API of this module is subject to change
without backwards compatibility concerns between releases. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8ca7a889-0bc0-41ee-9ee3-7ec0e227ad8c | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,038 | supabase-export-v2 | 09766549e959a21c | Python is started in isolated mode (command line option ``-I``), except if the *__isolated* keyword-only parameter is set to ``False``.
.. versionchanged:: 3.9
The function no longer strips whitespaces from *stderr*. | trusted_official_docs | CPython Docs | Python is started in isolated mode (command line option ``-I``), except if the *__isolated* keyword-only parameter is set to ``False``.
.. versionchanged:: 3.9
The function no longer strips whitespaces from *stderr*. | Python is started in isolated mode (command line option ``-I``), except if the *__isolated* keyword-only parameter is set to ``False``.
.. versionchanged:: 3.9
The function no longer strips whitespaces from *stderr*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8d911051-24e0-4c1c-8e59-79ad073f72bf | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,941 | supabase-export-v2 | ff373352b13d7ae0 | .. function:: reap_children()
Use this at the end of ``test_main`` whenever sub-processes are started. This will help ensure that no extra children (zombies) stick around to
hog resources and create problems when looking for refleaks. | trusted_official_docs | CPython Docs | .. function:: reap_children()
Use this at the end of ``test_main`` whenever sub-processes are started. This will help ensure that no extra children (zombies) stick around to
hog resources and create problems when looking for refleaks. | .. function:: reap_children()
Use this at the end of ``test_main`` whenever sub-processes are started. This will help ensure that no extra children (zombies) stick around to
hog resources and create problems when looking for refleaks. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
92ee29dc-0ad5-49d9-9751-d738a7ca9ccf | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,207 | supabase-export-v2 | 397373d032dcbe7a | raised. It is approximately equivalent to calling ``warnings.catch_warnings(record=True)`` with :meth:`warnings.simplefilter` set to ``always`` and with the option to automatically validate the results that are recorded.
``check_warnings`` accepts 2-tuples of the form ``("message regexp",
WarningCategory)`` as positio... | trusted_official_docs | CPython Docs | raised. It is approximately equivalent to calling ``warnings.catch_warnings(record=True)`` with :meth:`warnings.simplefilter` set to ``always`` and with the option to automatically validate the results that are recorded.
``check_warnings`` accepts 2-tuples of the form ``("message regexp",
WarningCategory)`` as positio... | raised. It is approximately equivalent to calling ``warnings.catch_warnings(record=True)`` with :meth:`warnings.simplefilter` set to ``always`` and with the option to automatically validate the results that are recorded.
``check_warnings`` accepts 2-tuples of the form ``("message regexp",
WarningCategory)`` as positio... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
94dcefde-b7b5-4b99-8ca0-315b47e9c875 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,115 | supabase-export-v2 | 5999dc1814a5e335 | interface for querying/modifying the underlying ``os.environ``. After exit from the context manager all changes to environment variables done through this instance will be rolled back.
.. versionchanged:: 3.1
Added dictionary interface. | trusted_official_docs | CPython Docs | interface for querying/modifying the underlying ``os.environ``. After exit from the context manager all changes to environment variables done through this instance will be rolled back.
.. versionchanged:: 3.1
Added dictionary interface. | interface for querying/modifying the underlying ``os.environ``. After exit from the context manager all changes to environment variables done through this instance will be rolled back.
.. versionchanged:: 3.1
Added dictionary interface. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
97f4aefe-d79a-4c92-85d8-3fc609f2f2c9 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,686 | supabase-export-v2 | 216c290f96db12e5 | The goal for regression testing is to try to break code. This leads to a few guidelines to be followed:
* The testing suite should exercise all classes, functions, and constants. This
includes not just the external API that is to be presented to the outside
world but also "private" code. | trusted_official_docs | CPython Docs | The goal for regression testing is to try to break code. This leads to a few guidelines to be followed:
* The testing suite should exercise all classes, functions, and constants. This
includes not just the external API that is to be presented to the outside
world but also "private" code. | The goal for regression testing is to try to break code. This leads to a few guidelines to be followed:
* The testing suite should exercise all classes, functions, and constants. This
includes not just the external API that is to be presented to the outside
world but also "private" code. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9cb986f5-4096-426b-9483-739d535e885c | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,203 | supabase-export-v2 | 94064f1f827a67c0 | .. function:: check_syntax_warning(testcase, statement, errtext='', *, lineno=1, offset=None)
Test for syntax warning in *statement* by attempting to compile *statement*. Test also that the :exc:`SyntaxWarning` is emitted only once, and that it
will be converted to a :exc:`SyntaxError` when turned into error. *testcas... | trusted_official_docs | CPython Docs | .. function:: check_syntax_warning(testcase, statement, errtext='', *, lineno=1, offset=None)
Test for syntax warning in *statement* by attempting to compile *statement*. Test also that the :exc:`SyntaxWarning` is emitted only once, and that it
will be converted to a :exc:`SyntaxError` when turned into error. *testcas... | .. function:: check_syntax_warning(testcase, statement, errtext='', *, lineno=1, offset=None)
Test for syntax warning in *statement* by attempting to compile *statement*. Test also that the :exc:`SyntaxWarning` is emitted only once, and that it
will be converted to a :exc:`SyntaxError` when turned into error. *testcas... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9d3ee9bd-5987-4dd3-a25f-60b9bda6a1ad | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,891 | supabase-export-v2 | d221e26e1b14aed5 | .. decorator:: run_with_locale(catstr, *locales)
A decorator for running a function in a different locale, correctly
resetting it after it has finished. *catstr* is the locale category as
a string (for example ``"LC_ALL"``). The *locales* passed will be tried
sequentially, and the first valid locale will be used. | trusted_official_docs | CPython Docs | .. decorator:: run_with_locale(catstr, *locales)
A decorator for running a function in a different locale, correctly
resetting it after it has finished. *catstr* is the locale category as
a string (for example ``"LC_ALL"``). The *locales* passed will be tried
sequentially, and the first valid locale will be used. | .. decorator:: run_with_locale(catstr, *locales)
A decorator for running a function in a different locale, correctly
resetting it after it has finished. *catstr* is the locale category as
a string (for example ``"LC_ALL"``). The *locales* passed will be tried
sequentially, and the first valid locale will be used. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9db52862-3978-4984-ab33-032e09e52db5 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,958 | supabase-export-v2 | 05ae954c7b81816e | .. function:: detect_api_mismatch(ref_api, other_api, *, ignore=())
Returns the set of attributes, functions or methods of *ref_api* not
found on *other_api*, except for a defined list of items to be
ignored in this check specified in *ignore*. | trusted_official_docs | CPython Docs | .. function:: detect_api_mismatch(ref_api, other_api, *, ignore=())
Returns the set of attributes, functions or methods of *ref_api* not
found on *other_api*, except for a defined list of items to be
ignored in this check specified in *ignore*. | .. function:: detect_api_mismatch(ref_api, other_api, *, ignore=())
Returns the set of attributes, functions or methods of *ref_api* not
found on *other_api*, except for a defined list of items to be
ignored in this check specified in *ignore*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9dc9abc5-d47d-4c59-8c6a-f0c2a7fc0548 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,870 | supabase-export-v2 | 1837fa173f159fb1 | .. function:: flush_std_streams()
Call the ``flush()`` method on :data:`sys.stdout` and then on
:data:`sys.stderr`. It can be used to make sure that the logs order is
consistent before writing into stderr. | trusted_official_docs | CPython Docs | .. function:: flush_std_streams()
Call the ``flush()`` method on :data:`sys.stdout` and then on
:data:`sys.stderr`. It can be used to make sure that the logs order is
consistent before writing into stderr. | .. function:: flush_std_streams()
Call the ``flush()`` method on :data:`sys.stdout` and then on
:data:`sys.stderr`. It can be used to make sure that the logs order is
consistent before writing into stderr. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9dfc4ba6-da48-45f1-9ef0-3b8668d43be4 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,826 | supabase-export-v2 | 6a999306bb4a7844 | named *filename*. If no match is found *filename* is returned. This does not equal a failure since it could be the path to the file.
Setting *subdir* indicates a relative path to use to find the file
rather than looking directly in the path directories. | trusted_official_docs | CPython Docs | named *filename*. If no match is found *filename* is returned. This does not equal a failure since it could be the path to the file.
Setting *subdir* indicates a relative path to use to find the file
rather than looking directly in the path directories. | named *filename*. If no match is found *filename* is returned. This does not equal a failure since it could be the path to the file.
Setting *subdir* indicates a relative path to use to find the file
rather than looking directly in the path directories. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a261fb62-0567-4ecb-bacd-d9086e4e493e | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,692 | supabase-export-v2 | 49e7482745aab2cd | * Make sure to clean up after your tests (such as close and remove all temporary files).
* If a test is dependent on a specific condition of the operating system then
verify the condition already exists before attempting the test. | trusted_official_docs | CPython Docs | * Make sure to clean up after your tests (such as close and remove all temporary files).
* If a test is dependent on a specific condition of the operating system then
verify the condition already exists before attempting the test. | * Make sure to clean up after your tests (such as close and remove all temporary files).
* If a test is dependent on a specific condition of the operating system then
verify the condition already exists before attempting the test. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a3f9804e-02ed-4ca3-aa2a-59368b1250e2 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,708 | supabase-export-v2 | b7ac2d8ff23e4f6d | passed to the script. Specifying a single regression test (:program:`python -m test test_spam`) will minimize output and only print whether the test passed or failed.
Running :mod:`!test` directly allows what resources are available for
tests to use to be set. You do this by using the ``-u`` command-line
option. Specif... | trusted_official_docs | CPython Docs | passed to the script. Specifying a single regression test (:program:`python -m test test_spam`) will minimize output and only print whether the test passed or failed.
Running :mod:`!test` directly allows what resources are available for
tests to use to be set. You do this by using the ``-u`` command-line
option. Specif... | passed to the script. Specifying a single regression test (:program:`python -m test test_spam`) will minimize output and only print whether the test passed or failed.
Running :mod:`!test` directly allows what resources are available for
tests to use to be set. You do this by using the ``-u`` command-line
option. Specif... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a52a9724-ccd6-4bf2-939f-4c5a24ffec11 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,936 | supabase-export-v2 | 63df102b0391474e | version if it is known. Intended for use in ``skip`` decorators. ``emscripten`` and ``wasi`` are assumed to be compiled with ``musl``; otherwise ``platform.libc_ver`` is checked.
.. function:: check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=None) | trusted_official_docs | CPython Docs | version if it is known. Intended for use in ``skip`` decorators. ``emscripten`` and ``wasi`` are assumed to be compiled with ``musl``; otherwise ``platform.libc_ver`` is checked.
.. function:: check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=None) | version if it is known. Intended for use in ``skip`` decorators. ``emscripten`` and ``wasi`` are assumed to be compiled with ``musl``; otherwise ``platform.libc_ver`` is checked.
.. function:: check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=None) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a9cfb6fa-7db4-4780-8fb0-383733203d16 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,191 | supabase-export-v2 | 6d3d6f8a0959312f | This makes a copy of :data:`sys.path`, appends any directories given as positional arguments, then reverts :data:`sys.path` to the copied settings when the context ends.
Note that *all* :data:`sys.path` modifications in the body of the
context manager, including replacement of the object,
will be reverted at the end ... | trusted_official_docs | CPython Docs | This makes a copy of :data:`sys.path`, appends any directories given as positional arguments, then reverts :data:`sys.path` to the copied settings when the context ends.
Note that *all* :data:`sys.path` modifications in the body of the
context manager, including replacement of the object,
will be reverted at the end ... | This makes a copy of :data:`sys.path`, appends any directories given as positional arguments, then reverts :data:`sys.path` to the copied settings when the context ends.
Note that *all* :data:`sys.path` modifications in the body of the
context manager, including replacement of the object,
will be reverted at the end ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ab63ee54-16fa-4e16-ae8b-b0039a63244e | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,987 | supabase-export-v2 | 6c8472f4dd8dae4b | .. function:: adjust_int_max_str_digits(max_digits)
This function returns a context manager that will change the global
:func:`sys.set_int_max_str_digits` setting for the duration of the
context to allow execution of test code that needs a different limit
on the number of digits when converting between an integer an... | trusted_official_docs | CPython Docs | .. function:: adjust_int_max_str_digits(max_digits)
This function returns a context manager that will change the global
:func:`sys.set_int_max_str_digits` setting for the duration of the
context to allow execution of test code that needs a different limit
on the number of digits when converting between an integer an... | .. function:: adjust_int_max_str_digits(max_digits)
This function returns a context manager that will change the global
:func:`sys.set_int_max_str_digits` setting for the duration of the
context to allow execution of test code that needs a different limit
on the number of digits when converting between an integer an... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ab98cec9-d8e3-4366-acfd-f80b0629560c | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,862 | supabase-export-v2 | a666f452f9e1750e | at the end of the block. If ``attr`` doesn't exist on ``obj``, it will be created and then deleted at the end of the block.
The old value (or ``None`` if it doesn't exist) will be assigned to the
target of the "as" clause, if there is one. | trusted_official_docs | CPython Docs | at the end of the block. If ``attr`` doesn't exist on ``obj``, it will be created and then deleted at the end of the block.
The old value (or ``None`` if it doesn't exist) will be assigned to the
target of the "as" clause, if there is one. | at the end of the block. If ``attr`` doesn't exist on ``obj``, it will be created and then deleted at the end of the block.
The old value (or ``None`` if it doesn't exist) will be assigned to the
target of the "as" clause, if there is one. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ae59564c-79b0-49b0-a905-706d0e767434 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,930 | supabase-export-v2 | 477669d0d17178e0 | Decorator for bigmem tests.
*size* is a requested size for the test (in arbitrary, test-interpreted
units.) *memuse* is the number of bytes per unit for the test, or a good
estimate of it. For example, a test that needs two byte buffers, of 4 GiB
each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``. | trusted_official_docs | CPython Docs | Decorator for bigmem tests.
*size* is a requested size for the test (in arbitrary, test-interpreted
units.) *memuse* is the number of bytes per unit for the test, or a good
estimate of it. For example, a test that needs two byte buffers, of 4 GiB
each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``. | Decorator for bigmem tests.
*size* is a requested size for the test (in arbitrary, test-interpreted
units.) *memuse* is the number of bytes per unit for the test, or a good
estimate of it. For example, a test that needs two byte buffers, of 4 GiB
each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bc9f4bb2-0875-40b3-a402-717d372d4448 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,689 | supabase-export-v2 | 2f3e39c21fe338bf | values are tested including invalid ones. This makes sure that not only all valid values are acceptable but also that improper values are handled correctly.
* Exhaust as many code paths as possible. Test where branching occurs and thus
tailor input to make sure as many different paths through the code are taken. | trusted_official_docs | CPython Docs | values are tested including invalid ones. This makes sure that not only all valid values are acceptable but also that improper values are handled correctly.
* Exhaust as many code paths as possible. Test where branching occurs and thus
tailor input to make sure as many different paths through the code are taken. | values are tested including invalid ones. This makes sure that not only all valid values are acceptable but also that improper values are handled correctly.
* Exhaust as many code paths as possible. Test where branching occurs and thus
tailor input to make sure as many different paths through the code are taken. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c3c0afd9-7fa2-4429-8867-d597c2d6837f | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,665 | supabase-export-v2 | 663b95bb6963511e | regression tests for Python as well as the modules :mod:`test.support` and :mod:`test.regrtest`. :mod:`test.support` is used to enhance your tests while :mod:`test.regrtest` drives the testing suite.
Each module in the :mod:`!test` package whose name starts with ``test_`` is a
testing suite for a specific module or fea... | trusted_official_docs | CPython Docs | regression tests for Python as well as the modules :mod:`test.support` and :mod:`test.regrtest`. :mod:`test.support` is used to enhance your tests while :mod:`test.regrtest` drives the testing suite.
Each module in the :mod:`!test` package whose name starts with ``test_`` is a
testing suite for a specific module or fea... | regression tests for Python as well as the modules :mod:`test.support` and :mod:`test.regrtest`. :mod:`test.support` is used to enhance your tests while :mod:`test.regrtest` drives the testing suite.
Each module in the :mod:`!test` package whose name starts with ``test_`` is a
testing suite for a specific module or fea... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c52b1f8d-8c23-4290-aabb-35c736aaa30d | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,884 | supabase-export-v2 | 6abceaacbcb1432a | the size of the :c:type:`PyVarObject` whose structure members are defined by *fmt*. The returned value includes the size of the Python object header and alignment.
.. function:: checksizeof(test, o, size) | trusted_official_docs | CPython Docs | the size of the :c:type:`PyVarObject` whose structure members are defined by *fmt*. The returned value includes the size of the Python object header and alignment.
.. function:: checksizeof(test, o, size) | the size of the :c:type:`PyVarObject` whose structure members are defined by *fmt*. The returned value includes the size of the Python object header and alignment.
.. function:: checksizeof(test, o, size) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c860d346-19cf-4e19-929b-4ab7b992a11a | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,757 | supabase-export-v2 | 19862a6a686a67d0 | Timeout in seconds to detect when a test hangs.
It is long enough to reduce the risk of test failure on the slowest Python
buildbots. It should not be used to mark a test as failed if the test takes
"too long". The timeout value depends on the regrtest ``--timeout`` command
line option. | trusted_official_docs | CPython Docs | Timeout in seconds to detect when a test hangs.
It is long enough to reduce the risk of test failure on the slowest Python
buildbots. It should not be used to mark a test as failed if the test takes
"too long". The timeout value depends on the regrtest ``--timeout`` command
line option. | Timeout in seconds to detect when a test hangs.
It is long enough to reduce the risk of test failure on the slowest Python
buildbots. It should not be used to mark a test as failed if the test takes
"too long". The timeout value depends on the regrtest ``--timeout`` command
line option. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ca7a0e51-02a5-4beb-beb6-e2be434ad552 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,671 | supabase-export-v2 | 65130e312b197a94 | Writing Unit Tests for the :mod:`!test` package -----------------------------------------------
It is preferred that tests that use the :mod:`unittest` module follow a few
guidelines. One is to name the test module by starting it with ``test_`` and end
it with the name of the module being tested. The test methods in th... | trusted_official_docs | CPython Docs | Writing Unit Tests for the :mod:`!test` package -----------------------------------------------
It is preferred that tests that use the :mod:`unittest` module follow a few
guidelines. One is to name the test module by starting it with ``test_`` and end
it with the name of the module being tested. The test methods in th... | Writing Unit Tests for the :mod:`!test` package -----------------------------------------------
It is preferred that tests that use the :mod:`unittest` module follow a few
guidelines. One is to name the test module by starting it with ``test_`` and end
it with the name of the module being tested. The test methods in th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cb6177b9-5591-45de-a93c-a96a06469ecd | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,962 | supabase-export-v2 | cf032e5c651a252e | .. function:: patch(test_instance, object_to_patch, attr_name, new_value)
Override *object_to_patch.attr_name* with *new_value*. Also add
cleanup procedure to *test_instance* to restore *object_to_patch* for
*attr_name*. The *attr_name* should be a valid attribute for
*object_to_patch*. | trusted_official_docs | CPython Docs | .. function:: patch(test_instance, object_to_patch, attr_name, new_value)
Override *object_to_patch.attr_name* with *new_value*. Also add
cleanup procedure to *test_instance* to restore *object_to_patch* for
*attr_name*. The *attr_name* should be a valid attribute for
*object_to_patch*. | .. function:: patch(test_instance, object_to_patch, attr_name, new_value)
Override *object_to_patch.attr_name* with *new_value*. Also add
cleanup procedure to *test_instance* to restore *object_to_patch* for
*attr_name*. The *attr_name* should be a valid attribute for
*object_to_patch*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cb93a2c3-88b8-46a3-b9ae-3e02a91850ad | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,685 | supabase-export-v2 | b58aa80491d376e3 | testing suite to be run by :mod:`test.regrtest`, on its own as a script that supports the :mod:`unittest` CLI, or via the ``python -m unittest`` CLI.
The goal for regression testing is to try to break code. This leads to a few
guidelines to be followed: | trusted_official_docs | CPython Docs | testing suite to be run by :mod:`test.regrtest`, on its own as a script that supports the :mod:`unittest` CLI, or via the ``python -m unittest`` CLI.
The goal for regression testing is to try to break code. This leads to a few
guidelines to be followed: | testing suite to be run by :mod:`test.regrtest`, on its own as a script that supports the :mod:`unittest` CLI, or via the ``python -m unittest`` CLI.
The goal for regression testing is to try to break code. This leads to a few
guidelines to be followed: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cdc79d2c-8da6-4512-bf21-652d7aa430c9 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,036 | supabase-export-v2 | 6c8c9c8b8de92a22 | Assert that running the interpreter with *args* and optional environment variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, stdout, stderr)`` tuple.
If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a fresh
environment. | trusted_official_docs | CPython Docs | Assert that running the interpreter with *args* and optional environment variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, stdout, stderr)`` tuple.
If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a fresh
environment. | Assert that running the interpreter with *args* and optional environment variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, stdout, stderr)`` tuple.
If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a fresh
environment. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d00eb427-a575-4964-b806-d3853e3e189e | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,971 | supabase-export-v2 | 42a06cff469d1946 | Assert that the ``__all__`` variable of *module* contains all public names.
The module's public names (its API) are detected automatically
based on whether they match the public name convention and were defined in
*module*. | trusted_official_docs | CPython Docs | Assert that the ``__all__`` variable of *module* contains all public names.
The module's public names (its API) are detected automatically
based on whether they match the public name convention and were defined in
*module*. | Assert that the ``__all__`` variable of *module* contains all public names.
The module's public names (its API) are detected automatically
based on whether they match the public name convention and were defined in
*module*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d085746d-0ea5-4b0d-bfb8-c9e3254f01e9 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,747 | supabase-export-v2 | b490f4ae9942d7d4 | The timeout is short enough to prevent a test to wait for too long if the internet request is blocked for whatever reason.
Usually, a timeout using :data:`INTERNET_TIMEOUT` should not mark a test as
failed, but skip the test instead: see
:func:`~test.support.socket_helper.transient_internet`. | trusted_official_docs | CPython Docs | The timeout is short enough to prevent a test to wait for too long if the internet request is blocked for whatever reason.
Usually, a timeout using :data:`INTERNET_TIMEOUT` should not mark a test as
failed, but skip the test instead: see
:func:`~test.support.socket_helper.transient_internet`. | The timeout is short enough to prevent a test to wait for too long if the internet request is blocked for whatever reason.
Usually, a timeout using :data:`INTERNET_TIMEOUT` should not mark a test as
failed, but skip the test instead: see
:func:`~test.support.socket_helper.transient_internet`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d19c8c5a-cd70-4296-b029-3df39bc08151 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,672 | supabase-export-v2 | 2b0d8dac7fee6ebb | for test methods. This is done because documentation strings get printed out if they exist and thus what test is being run is not stated.
A basic boilerplate is often used:: | trusted_official_docs | CPython Docs | for test methods. This is done because documentation strings get printed out if they exist and thus what test is being run is not stated.
A basic boilerplate is often used:: | for test methods. This is done because documentation strings get printed out if they exist and thus what test is being run is not stated.
A basic boilerplate is often used:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d306f44c-7fa0-4566-90bf-05348cc2c2f8 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,208 | supabase-export-v2 | 215a3d6d16503c96 | are raised that do not match any of the specified filters the test fails. To disable the first of these checks, set *quiet* to ``True``.
If no arguments are specified, it defaults to:: | trusted_official_docs | CPython Docs | are raised that do not match any of the specified filters the test fails. To disable the first of these checks, set *quiet* to ``True``.
If no arguments are specified, it defaults to:: | are raised that do not match any of the specified filters the test fails. To disable the first of these checks, set *quiet* to ``True``.
If no arguments are specified, it defaults to:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d429c7e0-553d-4edd-87f0-848059c9c64d | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,078 | supabase-export-v2 | 9a02cd27f76675e1 | .. function:: start_threads(threads, unlock=None)
Context manager to start *threads*, which is a sequence of threads. *unlock* is a function called after the threads are started, even if an
exception was raised; an example would be :meth:`threading.Event.set`. ``start_threads`` will attempt to join the started threads... | trusted_official_docs | CPython Docs | .. function:: start_threads(threads, unlock=None)
Context manager to start *threads*, which is a sequence of threads. *unlock* is a function called after the threads are started, even if an
exception was raised; an example would be :meth:`threading.Event.set`. ``start_threads`` will attempt to join the started threads... | .. function:: start_threads(threads, unlock=None)
Context manager to start *threads*, which is a sequence of threads. *unlock* is a function called after the threads are started, even if an
exception was raised; an example would be :meth:`threading.Event.set`. ``start_threads`` will attempt to join the started threads... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d654c46b-c9c9-4ae1-8742-ea1e59661f73 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,094 | supabase-export-v2 | bd1e8bcdf6b50a1f | # check the thread exception, use cm attributes: # exc_type, exc_value, exc_traceback, thread ...
# exc_type, exc_value, exc_traceback, thread attributes of cm no longer
# exists at this point
# (to avoid reference cycles) | trusted_official_docs | CPython Docs | # check the thread exception, use cm attributes: # exc_type, exc_value, exc_traceback, thread ...
# exc_type, exc_value, exc_traceback, thread attributes of cm no longer
# exists at this point
# (to avoid reference cycles) | # check the thread exception, use cm attributes: # exc_type, exc_value, exc_traceback, thread ...
# exc_type, exc_value, exc_traceback, thread attributes of cm no longer
# exists at this point
# (to avoid reference cycles) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d78b2289-44f2-4194-8dc8-668cdbdad22c | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,694 | supabase-export-v2 | 387892d586db793f | and do it as soon as possible. This minimizes external dependencies of tests and also minimizes possible anomalous behavior from side-effects of importing a module.
* Try to maximize code reuse. On occasion, tests will vary by something as small
as what type of input is used. Minimize code duplication by subclassing a... | trusted_official_docs | CPython Docs | and do it as soon as possible. This minimizes external dependencies of tests and also minimizes possible anomalous behavior from side-effects of importing a module.
* Try to maximize code reuse. On occasion, tests will vary by something as small
as what type of input is used. Minimize code duplication by subclassing a... | and do it as soon as possible. This minimizes external dependencies of tests and also minimizes possible anomalous behavior from side-effects of importing a module.
* Try to maximize code reuse. On occasion, tests will vary by something as small
as what type of input is used. Minimize code duplication by subclassing a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d8811dcc-6212-4e65-bed4-1aa6db4ba30d | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,055 | supabase-export-v2 | 8b2d36c7c316f970 | .. function:: make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename, \ source, depth=1, compiled=False)
Create a zip package directory with a path of *zip_dir* and *zip_basename*
containing an empty ``__init__`` file and a file *script_basename*
containing the *source*. If *compiled* is ``True``, both source ... | trusted_official_docs | CPython Docs | .. function:: make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename, \ source, depth=1, compiled=False)
Create a zip package directory with a path of *zip_dir* and *zip_basename*
containing an empty ``__init__`` file and a file *script_basename*
containing the *source*. If *compiled* is ``True``, both source ... | .. function:: make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename, \ source, depth=1, compiled=False)
Create a zip package directory with a path of *zip_dir* and *zip_basename*
containing an empty ``__init__`` file and a file *script_basename*
containing the *source*. If *compiled* is ``True``, both source ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dc4a4cb6-f4ae-4368-b8ce-151f36414534 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,938 | supabase-export-v2 | 66ec2b2acd5252c7 | :exc:`SyntaxError`. If *lineno* is not ``None``, compares to the line of the exception. If *offset* is not ``None``, compares to the offset of the exception.
.. function:: open_urlresource(url, *args, **kw) | trusted_official_docs | CPython Docs | :exc:`SyntaxError`. If *lineno* is not ``None``, compares to the line of the exception. If *offset* is not ``None``, compares to the offset of the exception.
.. function:: open_urlresource(url, *args, **kw) | :exc:`SyntaxError`. If *lineno* is not ``None``, compares to the line of the exception. If *offset* is not ``None``, compares to the offset of the exception.
.. function:: open_urlresource(url, *args, **kw) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e0e5bb27-a696-4d12-94cc-5d0398c4dce5 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,110 | supabase-export-v2 | 4a1045a4f8c7237b | .. data:: TESTFN_UNDECODABLE
Set to a filename (bytes type) that should not be able to be decoded by
file system encoding in strict mode. It may be ``None`` if it's not
possible to generate such a filename. | trusted_official_docs | CPython Docs | .. data:: TESTFN_UNDECODABLE
Set to a filename (bytes type) that should not be able to be decoded by
file system encoding in strict mode. It may be ``None`` if it's not
possible to generate such a filename. | .. data:: TESTFN_UNDECODABLE
Set to a filename (bytes type) that should not be able to be decoded by
file system encoding in strict mode. It may be ``None`` if it's not
possible to generate such a filename. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e239fee2-38b0-42e3-9552-fa47a0462c2f | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,931 | supabase-export-v2 | e8dc34b60ea5cae5 | or a good estimate of it. For example, a test that needs two byte buffers, of 4 GiB each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``.
The *size* argument is normally passed to the decorated test method as an
extra argument. If *dry_run* is ``True``, the value passed to the test
method may be less tha... | trusted_official_docs | CPython Docs | or a good estimate of it. For example, a test that needs two byte buffers, of 4 GiB each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``.
The *size* argument is normally passed to the decorated test method as an
extra argument. If *dry_run* is ``True``, the value passed to the test
method may be less tha... | or a good estimate of it. For example, a test that needs two byte buffers, of 4 GiB each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``.
The *size* argument is normally passed to the decorated test method as an
extra argument. If *dry_run* is ``True``, the value passed to the test
method may be less tha... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e2665b49-87be-433d-84a3-34fcab7cd95e | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,212 | supabase-export-v2 | 3e7a0be5336ee37d | If no warning has been raised, then any of the attributes that would otherwise be expected on an object representing a warning will return ``None``.
The recorder object also has a :meth:`reset` method, which clears the
warnings list. | trusted_official_docs | CPython Docs | If no warning has been raised, then any of the attributes that would otherwise be expected on an object representing a warning will return ``None``.
The recorder object also has a :meth:`reset` method, which clears the
warnings list. | If no warning has been raised, then any of the attributes that would otherwise be expected on an object representing a warning will return ``None``.
The recorder object also has a :meth:`reset` method, which clears the
warnings list. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e35b898e-d355-48bc-bb46-3f101bb37c18 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,148 | supabase-export-v2 | dcabbaaeb6af23da | A context manager that temporarily creates a new directory and changes the current working directory (CWD).
The context manager creates a temporary directory in the current
directory with name *name* before temporarily changing the current
working directory. If *name* is ``None``, the temporary directory is
created ... | trusted_official_docs | CPython Docs | A context manager that temporarily creates a new directory and changes the current working directory (CWD).
The context manager creates a temporary directory in the current
directory with name *name* before temporarily changing the current
working directory. If *name* is ``None``, the temporary directory is
created ... | A context manager that temporarily creates a new directory and changes the current working directory (CWD).
The context manager creates a temporary directory in the current
directory with name *name* before temporarily changing the current
working directory. If *name* is ``None``, the temporary directory is
created ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e942b3e3-fbf2-4dd7-8a60-dea98400367d | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,664 | supabase-export-v2 | 5232e9c8ea2cbc4d | --------------
The :mod:`!test` package contains all regression tests for Python as well as the
modules :mod:`test.support` and :mod:`test.regrtest`. :mod:`test.support` is used to enhance your tests while
:mod:`test.regrtest` drives the testing suite. | trusted_official_docs | CPython Docs | --------------
The :mod:`!test` package contains all regression tests for Python as well as the
modules :mod:`test.support` and :mod:`test.regrtest`. :mod:`test.support` is used to enhance your tests while
:mod:`test.regrtest` drives the testing suite. | --------------
The :mod:`!test` package contains all regression tests for Python as well as the
modules :mod:`test.support` and :mod:`test.regrtest`. :mod:`test.support` is used to enhance your tests while
:mod:`test.regrtest` drives the testing suite. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ea343cac-8197-495e-92e4-7555c0a68237 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,187 | supabase-export-v2 | 2e870abbbfeca45d | import to return a new module reference. This is useful for testing module-level behaviors, such as the emission of a :exc:`DeprecationWarning` on import. Example usage::
with CleanImport('foo'):
importlib.import_module('foo') # New reference. | trusted_official_docs | CPython Docs | import to return a new module reference. This is useful for testing module-level behaviors, such as the emission of a :exc:`DeprecationWarning` on import. Example usage::
with CleanImport('foo'):
importlib.import_module('foo') # New reference. | import to return a new module reference. This is useful for testing module-level behaviors, such as the emission of a :exc:`DeprecationWarning` on import. Example usage::
with CleanImport('foo'):
importlib.import_module('foo') # New reference. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eb75c2cd-4a49-412a-9769-d87f54e7a77a | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,175 | supabase-export-v2 | feae341919c64b76 | This function imports and returns the named module. Unlike a normal import, this function raises :exc:`unittest.SkipTest` if the module cannot be imported.
Module and package deprecation messages are suppressed during this import
if *deprecated* is ``True``. If a module is required on a platform but
optional for othe... | trusted_official_docs | CPython Docs | This function imports and returns the named module. Unlike a normal import, this function raises :exc:`unittest.SkipTest` if the module cannot be imported.
Module and package deprecation messages are suppressed during this import
if *deprecated* is ``True``. If a module is required on a platform but
optional for othe... | This function imports and returns the named module. Unlike a normal import, this function raises :exc:`unittest.SkipTest` if the module cannot be imported.
Module and package deprecation messages are suppressed during this import
if *deprecated* is ``True``. If a module is required on a platform but
optional for othe... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f07d4382-0bb4-487f-a394-5b5ef7b7b8e6 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,868 | supabase-export-v2 | a22b347a15e9441c | at the end of the block. If ``item`` doesn't exist on ``obj``, it will be created and then deleted at the end of the block.
The old value (or ``None`` if it doesn't exist) will be assigned to the
target of the "as" clause, if there is one. | trusted_official_docs | CPython Docs | at the end of the block. If ``item`` doesn't exist on ``obj``, it will be created and then deleted at the end of the block.
The old value (or ``None`` if it doesn't exist) will be assigned to the
target of the "as" clause, if there is one. | at the end of the block. If ``item`` doesn't exist on ``obj``, it will be created and then deleted at the end of the block.
The old value (or ``None`` if it doesn't exist) will be assigned to the
target of the "as" clause, if there is one. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f23e016c-3741-47f2-8d19-946067845fac | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,139 | supabase-export-v2 | fb4ba186e24dac85 | .. function:: rmdir(filename)
Call :func:`os.rmdir` on *filename*. On Windows platforms, this is
wrapped with a wait loop that checks for the existence of the file,
which is needed due to antivirus programs that can hold files open and prevent
deletion. | trusted_official_docs | CPython Docs | .. function:: rmdir(filename)
Call :func:`os.rmdir` on *filename*. On Windows platforms, this is
wrapped with a wait loop that checks for the existence of the file,
which is needed due to antivirus programs that can hold files open and prevent
deletion. | .. function:: rmdir(filename)
Call :func:`os.rmdir` on *filename*. On Windows platforms, this is
wrapped with a wait loop that checks for the existence of the file,
which is needed due to antivirus programs that can hold files open and prevent
deletion. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f38fcbc4-ed69-4421-b024-f5b2baeee602 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,171 | supabase-export-v2 | eb0e12a763cf7f7f | Example use::
# Get copies of the warnings module for testing without affecting the
# version being used by the rest of the test suite. One copy uses the
# C implementation, the other is forced to use the pure Python fallback
# implementation
py_warnings = import_fresh_module('warnings', blocked=['_warnings'])
c_w... | trusted_official_docs | CPython Docs | Example use::
# Get copies of the warnings module for testing without affecting the
# version being used by the rest of the test suite. One copy uses the
# C implementation, the other is forced to use the pure Python fallback
# implementation
py_warnings = import_fresh_module('warnings', blocked=['_warnings'])
c_w... | Example use::
# Get copies of the warnings module for testing without affecting the
# version being used by the rest of the test suite. One copy uses the
# C implementation, the other is forced to use the pure Python fallback
# implementation
py_warnings = import_fresh_module('warnings', blocked=['_warnings'])
c_w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f85dff97-5c8e-4571-a870-27baa7553fab | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,688 | supabase-export-v2 | 1b414ebca14d0e5b | written) is preferred. Blackbox testing (testing only the published user interface) is not complete enough to make sure all boundary and edge cases are tested.
* Make sure all possible values are tested including invalid ones. This makes
sure that not only all valid values are acceptable but also that improper
values... | trusted_official_docs | CPython Docs | written) is preferred. Blackbox testing (testing only the published user interface) is not complete enough to make sure all boundary and edge cases are tested.
* Make sure all possible values are tested including invalid ones. This makes
sure that not only all valid values are acceptable but also that improper
values... | written) is preferred. Blackbox testing (testing only the published user interface) is not complete enough to make sure all boundary and edge cases are tested.
* Make sure all possible values are tested including invalid ones. This makes
sure that not only all valid values are acceptable but also that improper
values... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fac5ec6a-90b0-44ad-aa08-7a3fc22ba6a2 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 27,937 | supabase-export-v2 | 103ee67cf19589ff | .. function:: check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=None)
Test for syntax errors in *statement* by attempting to compile *statement*. *testcase* is the :mod:`unittest` instance for the test. *errtext* is the
regular expression which should match the string representation of the
ra... | trusted_official_docs | CPython Docs | .. function:: check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=None)
Test for syntax errors in *statement* by attempting to compile *statement*. *testcase* is the :mod:`unittest` instance for the test. *errtext* is the
regular expression which should match the string representation of the
ra... | .. function:: check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=None)
Test for syntax errors in *statement* by attempting to compile *statement*. *testcase* is the :mod:`unittest` instance for the test. *errtext* is the
regular expression which should match the string representation of the
ra... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fb12133d-3c9e-40fc-8c57-cb16b6e71a0e | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,051 | supabase-export-v2 | 51c961f1c2649f13 | .. function:: make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None)
Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which
contains the files in *script_name*. *name_in_zip* is the archive name. Return a tuple containing ``(full path, full path of archive name)``. | trusted_official_docs | CPython Docs | .. function:: make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None)
Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which
contains the files in *script_name*. *name_in_zip* is the archive name. Return a tuple containing ``(full path, full path of archive name)``. | .. function:: make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None)
Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which
contains the files in *script_name*. *name_in_zip* is the archive name. Return a tuple containing ``(full path, full path of archive name)``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fb4853a6-69c0-4a08-976f-f1b5e933436a | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,192 | supabase-export-v2 | b1ca1208c93e06ce | that *all* :data:`sys.path` modifications in the body of the context manager, including replacement of the object, will be reverted at the end of the block.
:mod:`!test.support.warnings_helper` --- Utilities for warnings tests
===================================================================== | trusted_official_docs | CPython Docs | that *all* :data:`sys.path` modifications in the body of the context manager, including replacement of the object, will be reverted at the end of the block.
:mod:`!test.support.warnings_helper` --- Utilities for warnings tests
===================================================================== | that *all* :data:`sys.path` modifications in the body of the context manager, including replacement of the object, will be reverted at the end of the block.
:mod:`!test.support.warnings_helper` --- Utilities for warnings tests
===================================================================== | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fc090567-165f-4bc4-89e0-f168384eb169 | CPython Docs | file://datasets/cpython/Doc/library/test.rst | unknown | f2df259e-f066-4432-b4ea-d3a1246b3883 | 28,166 | supabase-export-v2 | 80be7a0f6c4ebc80 | *fresh* is an iterable of additional module names that are also removed from the ``sys.modules`` cache before doing the import.
*blocked* is an iterable of module names that are replaced with ``None``
in the module cache during the import to ensure that attempts to import
them raise :exc:`ImportError`. | trusted_official_docs | CPython Docs | *fresh* is an iterable of additional module names that are also removed from the ``sys.modules`` cache before doing the import.
*blocked* is an iterable of module names that are replaced with ``None``
in the module cache during the import to ensure that attempts to import
them raise :exc:`ImportError`. | *fresh* is an iterable of additional module names that are also removed from the ``sys.modules`` cache before doing the import.
*blocked* is an iterable of module names that are replaced with ``None``
in the module cache during the import to ensure that attempts to import
them raise :exc:`ImportError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0be25b3f-04aa-4c0b-a037-814c9e356cfd | CPython Docs | file://datasets/cpython/Doc/library/string.templatelib.rst | unknown | fd9bc35b-614c-4ee3-9dc6-ac88639167fa | 28,312 | supabase-export-v2 | c4f9a2c3a364ea03 | * ``'s'`` which calls :func:`str` on the value (like ``!s``), * ``'r'`` which calls :func:`repr` (like ``!r``), and * ``'a'`` which calls :func:`ascii` (like ``!a``).
If the conversion flag is ``None``, *obj* is returned unchanged. | trusted_official_docs | CPython Docs | * ``'s'`` which calls :func:`str` on the value (like ``!s``), * ``'r'`` which calls :func:`repr` (like ``!r``), and * ``'a'`` which calls :func:`ascii` (like ``!a``).
If the conversion flag is ``None``, *obj* is returned unchanged. | * ``'s'`` which calls :func:`str` on the value (like ``!s``), * ``'r'`` which calls :func:`repr` (like ``!r``), and * ``'a'`` which calls :func:`ascii` (like ``!a``).
If the conversion flag is ``None``, *obj* is returned unchanged. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
114dedd1-b88b-4087-8889-28b62dbfb016 | CPython Docs | file://datasets/cpython/Doc/library/string.templatelib.rst | unknown | fd9bc35b-614c-4ee3-9dc6-ac88639167fa | 28,230 | supabase-export-v2 | fdebed824c9a1eb4 | .. versionadded:: 3.14
Template strings are a mechanism for custom string processing. They have the full flexibility of Python's :ref:`f-strings`,
but return a :class:`Template` instance that gives access
to the static and interpolated (in curly brackets) parts of a string
*before* they are combined. | trusted_official_docs | CPython Docs | .. versionadded:: 3.14
Template strings are a mechanism for custom string processing. They have the full flexibility of Python's :ref:`f-strings`,
but return a :class:`Template` instance that gives access
to the static and interpolated (in curly brackets) parts of a string
*before* they are combined. | .. versionadded:: 3.14
Template strings are a mechanism for custom string processing. They have the full flexibility of Python's :ref:`f-strings`,
but return a :class:`Template` instance that gives access
to the static and interpolated (in curly brackets) parts of a string
*before* they are combined. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
32330df3-73a6-4c18-b621-ab6f100ed877 | CPython Docs | file://datasets/cpython/Doc/library/string.templatelib.rst | unknown | fd9bc35b-614c-4ee3-9dc6-ac88639167fa | 28,288 | supabase-export-v2 | dd24db73f4937eb6 | .. attribute:: expression :type: str
For interpolations created by t-string literals, :attr:`!expression`
is the expression text found inside the curly brackets (``{`` & ``}``),
including any whitespace, excluding the curly brackets themselves,
and ending before the first ``!``, ``:``, or ``=`` if any is present. Fo... | trusted_official_docs | CPython Docs | .. attribute:: expression :type: str
For interpolations created by t-string literals, :attr:`!expression`
is the expression text found inside the curly brackets (``{`` & ``}``),
including any whitespace, excluding the curly brackets themselves,
and ending before the first ``!``, ``:``, or ``=`` if any is present. Fo... | .. attribute:: expression :type: str
For interpolations created by t-string literals, :attr:`!expression`
is the expression text found inside the curly brackets (``{`` & ``}``),
including any whitespace, excluding the curly brackets themselves,
and ending before the first ``!``, ``:``, or ``=`` if any is present. Fo... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
34bf825a-4a04-4b12-a854-da258786315b | CPython Docs | file://datasets/cpython/Doc/library/string.templatelib.rst | unknown | fd9bc35b-614c-4ee3-9dc6-ac88639167fa | 28,278 | supabase-export-v2 | 901f210019d2daf3 | should either wrap the string directly in a :class:`!Template` (to treat it as a static string) or use an :class:`!Interpolation` (to treat it as dynamic):
>>> from string.templatelib import Interpolation, Template
>>> template = t'Ah! '
>>> # Treat 'We do have ' as a static string
>>> template += Template('We do ha... | trusted_official_docs | CPython Docs | should either wrap the string directly in a :class:`!Template` (to treat it as a static string) or use an :class:`!Interpolation` (to treat it as dynamic):
>>> from string.templatelib import Interpolation, Template
>>> template = t'Ah! '
>>> # Treat 'We do have ' as a static string
>>> template += Template('We do ha... | should either wrap the string directly in a :class:`!Template` (to treat it as a static string) or use an :class:`!Interpolation` (to treat it as dynamic):
>>> from string.templatelib import Interpolation, Template
>>> template = t'Ah! '
>>> # Treat 'We do have ' as a static string
>>> template += Template('We do ha... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
385aad18-9918-4558-964b-8148f2925624 | CPython Docs | file://datasets/cpython/Doc/library/string.templatelib.rst | unknown | fd9bc35b-614c-4ee3-9dc6-ac88639167fa | 28,270 | supabase-export-v2 | e259122b5876be3f | Iterate over the template, yielding each non-empty string and :class:`Interpolation` in the correct order:
>>> cheese = 'Camembert'
>>> list(t'Ah! We do have {cheese}.')
['Ah! We do have ', Interpolation('Camembert', 'cheese', None, ''), '.'] | trusted_official_docs | CPython Docs | Iterate over the template, yielding each non-empty string and :class:`Interpolation` in the correct order:
>>> cheese = 'Camembert'
>>> list(t'Ah! We do have {cheese}.')
['Ah! We do have ', Interpolation('Camembert', 'cheese', None, ''), '.'] | Iterate over the template, yielding each non-empty string and :class:`Interpolation` in the correct order:
>>> cheese = 'Camembert'
>>> list(t'Ah! We do have {cheese}.')
['Ah! We do have ', Interpolation('Camembert', 'cheese', None, ''), '.'] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
38ba20bb-72a8-421a-b723-b3bac10414b6 | CPython Docs | file://datasets/cpython/Doc/library/string.templatelib.rst | unknown | fd9bc35b-614c-4ee3-9dc6-ac88639167fa | 28,290 | supabase-export-v2 | 0092b4d10d47a94d | recommend using valid Python expressions or the empty string for the ``expression`` field of manually created :class:`!Interpolation` instances, although this is not enforced at runtime.
>>> t'{1 + 2}'.interpolations[0].expression
'1 + 2' | trusted_official_docs | CPython Docs | recommend using valid Python expressions or the empty string for the ``expression`` field of manually created :class:`!Interpolation` instances, although this is not enforced at runtime.
>>> t'{1 + 2}'.interpolations[0].expression
'1 + 2' | recommend using valid Python expressions or the empty string for the ``expression`` field of manually created :class:`!Interpolation` instances, although this is not enforced at runtime.
>>> t'{1 + 2}'.interpolations[0].expression
'1 + 2' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
39014d71-a110-47ca-a233-8283687b2cb3 | CPython Docs | file://datasets/cpython/Doc/library/string.templatelib.rst | unknown | fd9bc35b-614c-4ee3-9dc6-ac88639167fa | 28,265 | supabase-export-v2 | 1bba929277e2cc7c | they will be concatenated into a single value in the :attr:`~Template.strings` attribute. For example, the following code creates a :class:`Template` with a single final string:
>>> from string.templatelib import Template
>>> template = Template('Ah! We do have ', 'Camembert', '.')
>>> template.strings
('Ah! We do h... | trusted_official_docs | CPython Docs | they will be concatenated into a single value in the :attr:`~Template.strings` attribute. For example, the following code creates a :class:`Template` with a single final string:
>>> from string.templatelib import Template
>>> template = Template('Ah! We do have ', 'Camembert', '.')
>>> template.strings
('Ah! We do h... | they will be concatenated into a single value in the :attr:`~Template.strings` attribute. For example, the following code creates a :class:`Template` with a single final string:
>>> from string.templatelib import Template
>>> template = Template('Ah! We do have ', 'Camembert', '.')
>>> template.strings
('Ah! We do h... | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.