repo_id stringclasses 400
values | commit_sha stringclasses 400
values | commit_index int32 0 951 | in_repo_split stringclasses 1
value | cross_repo_split stringclasses 1
value | test_file stringlengths 7 121 | test_function stringlengths 1 108 | assertion_type stringclasses 32
values | difficulty stringclasses 8
values | context_lines int32 3 600 | prefix large_stringlengths 44 113k | target large_stringlengths 1 498 | anchor_sha stringclasses 400
values | anchor_index int32 0 951 | qna_source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a90_core/test_utilhintget.py | test_get_hint_repr | assert | func_call | 56 | def test_get_hint_repr(hints_pep_meta) -> None:
'''
Test the :func:`beartype._util.hint.utilhintget.get_hint_repr` getter.
Parameters
----------
hints_pep_meta : List[beartype_test.a00_unit.data.hint.util.data_hintmetacls.HintPepMetadata]
List of type hint metadata describing sample type hi... | repr(hint_pep) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/kind/map/test_utilmapfrozen.py | test_frozendict | assert | func_call | 41 | def test_frozendict() -> None:
'''
Test the :func:`beartype._util.kind.map.utilmapfrozen.FrozenDict`
subclass.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar import BeartypeKindFrozenDictException
from b... | hash(THE_POET) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/kind/sequence/test_utilsequencemake.py | test_make_stack | assert | func_call | 13 | def test_make_stack() -> None:
'''
Test the :func:`beartype._util.kind.sequence.utilseqmake.make_stack`
function.
'''
# Defer test-specific imports.
from beartype._util.kind.sequence.utilseqmake import make_stack
# Assert that this factory creates the expected stack from empty iterables,
... | make_stack([]) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/door/a00_type/test_door_typehint.py | test_door_typehint_new | assert | func_call | 36 | from beartype_test._util.mark.pytmark import ignore_warnings
def test_door_typehint_new() -> None:
'''
Test the :meth:`beartype.door.TypeHint.__new__` factory method.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.d... | TypeHint(list) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/door/a00_type/test_door_typehint.py | test_door_typehint_getitem | assert | func_call | 22 | from beartype_test._util.mark.pytmark import ignore_warnings
def test_door_typehint_getitem() -> None:
'''
Test the :meth:`beartype.door.TypeHint.__getitem__` dunder method.
'''
# Defer test-specific imports.
from beartype.door import TypeHint
from beartype.typing import Union
# Arbitrary... | TypeHint(None) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/test_codenoop.py | test_decor_noop_redecorated_async | assert | func_call | 22 | async def test_decor_noop_redecorated_async() -> None:
'''
Test that the :func:`beartype.beartype` decorator efficiently reduces to a
noop on **asynchronous wrappers** (i.e., wrapper functions declared with
the ``async def`` rather than ``def`` keywords) generated by prior calls to
this decorator.
... | beartype(isha) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/test_codenoop.py | test_decor_noop_redecorated_sync | assert | func_call | 23 | def test_decor_noop_redecorated_sync() -> None:
'''
Test that the :func:`beartype.beartype` decorator efficiently reduces to a
noop on **synchronous wrappers** (i.e., wrapper functions declared with the
``def`` rather than ``async def`` keyword) generated by prior calls to this
decorator.
'''
... | beartype(xenos) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextrepr.py | test_represent_object | assert | func_call | 37 | def test_represent_object() -> None:
'''
Test the :func:`beartype._util.text.utiltextrepr.represent_object`
function.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.text.utiltextrepr import represent_object... | repr(ToASkylark) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a20_code/test_codescope.py | test_express_func_scope_type_ref | assert | func_call | 67 | def test_express_func_scope_type_ref() -> None:
'''
Test the
:func:`beartype._check.code.codescope.express_func_scope_type_ref`
function.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar import BeartypeDec... | repr(forwardref) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a90_core/test_utilhintget.py | test_get_hint_repr | assert | func_call | 26 | def test_get_hint_repr(hints_pep_meta) -> None:
'''
Test the :func:`beartype._util.hint.utilhintget.get_hint_repr` getter.
Parameters
----------
hints_pep_meta : List[beartype_test.a00_unit.data.hint.util.data_hintmetacls.HintPepMetadata]
List of type hint metadata describing sample type hi... | repr(nonhint_pep) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a00_error/a90_main/test_errorget.py | test_get_func_pith_violation_conf_is_color | assert | func_call | 67 | def test_get_func_pith_violation_conf_is_color() -> None:
'''
Test the
:func:`beartype._check.error.errget.get_func_pith_violation` getter with
respect to the :attr:`beartype.BeartypeConf.is_color` option.
'''
# ..................{ IMPORTS }..................
# De... | is_stdout_terminal() | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a90_func/z90_lib/a00_jax/test_equinox.py | test_equinox_filter_jit | assert | func_call | 97 | def test_equinox_filter_jit() -> None:
'''
Functional test validating that the :mod:`beartype` package successfully
type-checks callables decorated by the third-party
:func:`equinox.filter_jit` decorator annotated by type hints by the
third-party :mod:`jaxtyping` package.
See Also
--------
... | jax_numpy.array(2.0) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a90_func/z90_lib/a00_jax/test_equinox.py | test_equinox_filter_jit | assert | func_call | 99 | def test_equinox_filter_jit() -> None:
'''
Functional test validating that the :mod:`beartype` package successfully
type-checks callables decorated by the third-party
:func:`equinox.filter_jit` decorator annotated by type hints by the
third-party :mod:`jaxtyping` package.
See Also
--------
... | jax_numpy.array(0.0) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a90_func/z90_lib/a00_jax/test_jax.py | test_jax_jit | assert | func_call | 80 | def test_jax_jit() -> None:
'''
Functional test validating that the :mod:`beartype` package successfully
type-checks callables decorated by the third-party
:func:`equinox.filter_jit` decorator annotated by type hints by the
third-party :mod:`jaxtyping` package.
See Also
--------
https:/... | jax_numpy.array(2.0) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextrepr.py | test_represent_func | assert | func_call | 33 | def test_represent_func() -> None:
'''
Test the :func:`beartype._util.text.utiltextrepr.represent_func`
function.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.text.utiltextrepr import represent_func
f... | repr(function_partial) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/a00_cache/test_utilcachecall.py | test_callable_cached | assert | func_call | 90 | def test_callable_cached() -> None:
'''
Test the
:func:`beartype._util.cache.utilcachecall.callable_cached` decorator.
'''
# ..................{ IMPORTS }..................
# Defer test-specific imports.
from beartype.roar._roarexc import _BeartypeUtilCallableCach... | from_savage_men(bitter) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/a90_pep/test_decorpep557.py | test_decor_pep577 | assert | complex_expr | 72 | def test_decor_pep577() -> None:
'''
Test :pep:`557` support implemented in the :func:`beartype.beartype`
decorator if the active Python interpreter targets Python >= 3.8 *or* skip
otherwise.
'''
# ..................{ IMPORTS }..................
# Defer test-speci... | 0xBABE | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/data/claw/intraprocess/hookable_package/kind/data_claw_coro.py | _main | assert | complex_expr | 91 | from asyncio import (
run as asyncio_run,
)
from beartype.typing import (
Optional,
Union,
)
async def _shone(not_a_sound_was_heard: Union[float, bytes]) -> (
Optional[complex]):
'''
Arbitrary coroutine either returning the passed float first doubled and then
coerced into a complex number w... | 84 + 1j | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/data/pep/pep695/data_pep695util.py | unit_test_reduce_hint_pep695_unsubscripted | assert | complex_expr | 169 | def unit_test_is_hint_pep695_subscripted() -> None:
'''
Test the private
:mod:`beartype._util.hint.pep.proposal.pep695.is_hint_pep695_subscripted`
tester.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.... | str | int | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/a90_pep/test_decorpep563.py | test_pep563_hint_pep484_namedtuple | assert | complex_expr | 27 | from beartype_test._util.mark.pytskip import (
# skip,
skip_if_pypy,
skip_if_python_version_less_than,
skip_if_python_version_greater_than_or_equal_to,
)
def test_pep563_hint_pep484_namedtuple() -> None:
'''
Test module-scoped :pep:`563` support implemented in the
:func:`beartype.beartype` ... | 0xCAFEFACE | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/proposal/test_utilpep612.py | test_make_hint_pep612_concatenate_list_or_none | assert | complex_expr | 42 | def test_make_hint_pep612_concatenate_list_or_none() -> None:
'''
Test the private
:mod:`beartype._util.hint.pep.proposal.pep612.make_hint_pep612_concatenate_list_or_none`
factory.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports... | Concatenate[P] | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncscope.py | test_get_func_locals | assert | complex_expr | 151 | def attach_func_locals(**kwargs) -> 'collections.abc.Callable':
'''
Decorator attaching the local scope of the parent callable declaring the
passed callable to a new ``func_locals`` attribute of the passed callable.
Parameters
----------
This decorator forwards all passed keyword parameters as ... | Union[int, str] | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/test_utilobjectattr.py | test_get_object_attrs_name_to_value_explicit | assert | complex_expr | 65 | def test_get_object_attrs_name_to_value_explicit() -> None:
'''
Test both the
:func:`beartype._util.utilobjattr.get_object_attrs_name_to_value_explicit`
*and*
:func:`beartype._util.utilobjattr.get_object_methods_name_to_value_explicit`
getters, whose testing requires identical types and objects.... | of_fever.as_one | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncscope.py | test_get_func_locals | assert | complex_expr | 168 | def attach_func_locals(**kwargs) -> 'collections.abc.Callable':
'''
Decorator attaching the local scope of the parent callable declaring the
passed callable to a new ``func_locals`` attribute of the passed callable.
Parameters
----------
This decorator forwards all passed keyword parameters as ... | Union[bool, str] | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/typing/test_typingpep544.py | test_typingpep544_superclass | assert | complex_expr | 27 | def test_typingpep544_superclass() -> None:
'''
Test the public :class:`beartype.typing.Protocol` superclass.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.typing import (
Protocol as ProtocolFast,
T... | ProtocolFast[_T_co] | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/test_a90_utilpeptest.py | test_is_hint_pep_subscripted | assert | complex_expr | 25 | def test_is_hint_pep_subscripted(hints_pep_meta, hints_nonpep_meta) -> None:
'''
Test the :func:`beartype._util.hint.pep.utilpeptest.is_hint_pep_subscripted`
tester.
Parameters
----------
hints_pep_meta : List[beartype_test.a00_unit.data.hint.util.data_hintmetacls.HintPepMetadata]
List ... | hint_pep_meta.is_args | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/test_a00_utilpepget.py | test_get_hint_pep_sign | assert | complex_expr | 24 | def test_get_hint_pep_sign(hints_pep_meta) -> None:
'''
Test the
:func:`beartype._util.hint.pep.utilpepget.get_hint_pep_sign` getter.
Parameters
----------
hints_pep_meta : List[beartype_test.a00_unit.data.hint.util.data_hintmetacls.HintPepMetadata]
List of PEP-compliant type hint metad... | hint_pep_meta.pep_sign | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/a90_pep/test_decorpep563.py | test_pep563_class_self_reference_reloaded | assert | complex_expr | 54 | from beartype_test._util.mark.pytskip import (
# skip,
skip_if_pypy,
skip_if_python_version_less_than,
skip_if_python_version_greater_than_or_equal_to,
)
def test_pep563_class_self_reference_reloaded() -> None:
'''
Test module-scoped :pep:`563` support implemented in the
:func:`beartype.bea... | data_pep563_club.CLING | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a10_data/code/test_datacodeindent.py | test_data_indent_level_to_code | assert | complex_expr | 21 | def test_data_indent_level_to_code() -> None:
'''
Test the :obj:`beartype._data.code.datacodeindent.INDENT_LEVEL_TO_CODE`
dictionary singleton.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._data.code.datacodein... | INDENT_LEVEL_TO_CODE[1] | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a10_data/code/test_datacodeindent.py | test_data_indent_level_to_code | assert | complex_expr | 22 | def test_data_indent_level_to_code() -> None:
'''
Test the :obj:`beartype._data.code.datacodeindent.INDENT_LEVEL_TO_CODE`
dictionary singleton.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._data.code.datacodein... | INDENT_LEVEL_TO_CODE[2] | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/test_a90_utilpeptest.py | test_is_hint_pep_typing | assert | complex_expr | 22 | def test_is_hint_pep_typing(hints_pep_meta) -> None:
'''
Test the
:func:`beartype._util.hint.pep.utilpeptest.is_hint_pep_typing` tester.
Parameters
----------
hints_pep_meta : List[beartype_test.a00_unit.data.hint.util.data_hintmetacls.HintPepMetadata]
List of PEP-compliant type hint me... | hint_pep_meta.is_typing | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/a90_pep/test_decorpep563.py | test_pep563_class_self_reference_reloaded | assert | complex_expr | 48 | from beartype_test._util.mark.pytskip import (
# skip,
skip_if_pypy,
skip_if_python_version_less_than,
skip_if_python_version_greater_than_or_equal_to,
)
def test_pep563_class_self_reference_reloaded() -> None:
'''
Test module-scoped :pep:`563` support implemented in the
:func:`beartype.bea... | data_pep563_club.COLORS | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/a00_cache/test_utilcachecall.py | test_callable_cached | assert | complex_expr | 71 | def test_callable_cached() -> None:
'''
Test the
:func:`beartype._util.cache.utilcachecall.callable_cached` decorator.
'''
# ..................{ IMPORTS }..................
# Defer test-specific imports.
from beartype.roar._roarexc import _BeartypeUtilCallableCach... | exception_next_info.value | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/error/test_utilerrwarn.py | test_reissue_warnings_placeholder | assert | string_literal | 123 | def test_reissue_warnings_placeholder() -> None:
'''
Test the
:func:`beartype._util.error.utilerrwarn.reissue_warnings_placeholder`
function.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.error.utilerr... | '' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextjoin.py | test_join_delimited | assert | string_literal | 11 | def test_join_delimited() -> None:
'''
Test the :func:`beartype._util.text.utiltextjoin.join_delimited` function.
'''
# Defer test-specific imports.
from beartype._util.text.utiltextjoin import join_delimited
# Assert that joining a sequence of no strings returns the empty string.
asser | '' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextmunge.py | test_uppercase_str_char_first | assert | string_literal | 15 | def test_uppercase_str_char_first():
'''
Test the :func:`beartype._util.text.utiltextmunge.uppercase_str_char_first`
function.
'''
# Defer test-specific imports.
from beartype._util.text.utiltextmunge import uppercase_str_char_first
from pytest import raises
# Assert this munger return... | "" | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextmunge.py | test_truncate_str | assert | string_literal | 11 | def test_truncate_str():
'''
Test the :func:`beartype._util.text.utiltextmunge.truncate_str` function.
'''
# Defer test-specific imports.
from beartype._util.text.utiltextmunge import truncate_str
# Assert that truncating the empty string returns the empty string.
assert truncate_str(text... | '' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextmunge.py | test_truncate_str | assert | string_literal | 17 | def test_truncate_str():
'''
Test the :func:`beartype._util.text.utiltextmunge.truncate_str` function.
'''
# Defer test-specific imports.
from beartype._util.text.utiltextmunge import truncate_str
# Assert that truncating the empty string returns the empty string.
assert truncate_str(text=... | 'S' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a60_main/test_beartype.py | test_beartype | assert | string_literal | 178 | from beartype_test._util.mark.pytmark import ignore_warnings
@ignore_warnings(DeprecationWarning)
def test_beartype(iter_hints_piths_meta) -> None:
'''
Test the :func:`beartype.beartype` decorator with respect to type-checking
code dynamically generated by the
:mod:`beartype._decor.wrap.wrapmain` submo... | '_' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextmunge.py | test_truncate_str | assert | string_literal | 18 | def test_truncate_str():
'''
Test the :func:`beartype._util.text.utiltextmunge.truncate_str` function.
'''
# Defer test-specific imports.
from beartype._util.text.utiltextmunge import truncate_str
# Assert that truncating the empty string returns the empty string.
assert truncate_str(text=... | 'Se' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextrepr.py | test_represent_object | assert | string_literal | 44 | def test_represent_object() -> None:
'''
Test the :func:`beartype._util.text.utiltextrepr.represent_object`
function.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.text.utiltextrepr import represent_object... | '""' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextlabel.py | test_label_type | assert | string_literal | 13 | def test_label_type() -> None:
'''
Test the :func:`beartype._util.text.utiltextlabel.label_type`
function.
'''
# Defer test-specific imports.
from beartype._util.text.utiltextlabel import label_type
from beartype_test.a00_unit.data.data_type import Class
# Assert this labeller returns ... | 'str' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextmunge.py | test_truncate_str | assert | string_literal | 19 | def test_truncate_str():
'''
Test the :func:`beartype._util.text.utiltextmunge.truncate_str` function.
'''
# Defer test-specific imports.
from beartype._util.text.utiltextmunge import truncate_str
# Assert that truncating the empty string returns the empty string.
assert truncate_str(text=... | 'Sen' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a10_data/code/test_datacodeindent.py | test_data_indent_level_to_code | assert | string_literal | 16 | def test_data_indent_level_to_code() -> None:
'''
Test the :obj:`beartype._data.code.datacodeindent.INDENT_LEVEL_TO_CODE`
dictionary singleton.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._data.code.datacodein... | ' ' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextmunge.py | test_uppercase_str_char_first | assert | string_literal | 14 | def test_uppercase_str_char_first():
'''
Test the :func:`beartype._util.text.utiltextmunge.uppercase_str_char_first`
function.
'''
# Defer test-specific imports.
from beartype._util.text.utiltextmunge import uppercase_str_char_first
from pytest import raises
# Assert this munger return... | "<bear>" | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a10_data/code/test_datacodeindent.py | test_data_indent_level_to_code | assert | string_literal | 17 | def test_data_indent_level_to_code() -> None:
'''
Test the :obj:`beartype._data.code.datacodeindent.INDENT_LEVEL_TO_CODE`
dictionary singleton.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._data.code.datacodein... | ' ' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/error/test_utilerrget.py | test_get_name_error_attr_name | assert | string_literal | 31 | def test_get_name_error_attr_name() -> None:
'''
Test the
:func:`beartype._util.error.utilerrget.get_name_error_attr_name` getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.error.utilerrget import get_... | 'FreeAttr' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextmunge.py | test_uppercase_str_char_first | assert | string_literal | 13 | def test_uppercase_str_char_first():
'''
Test the :func:`beartype._util.text.utiltextmunge.uppercase_str_char_first`
function.
'''
# Defer test-specific imports.
from beartype._util.text.utiltextmunge import uppercase_str_char_first
from pytest import raises
# Assert this munger return... | "BeArTyPe" | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/cls/test_utilclsmake.py | test_make_type | assert | string_literal | 25 | def test_make_type() -> None:
'''
Test the :func:`beartype._util.cls.utilclsmake.make_type` tester.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roarexc import _BeartypeUtilTypeException
from beartype._ut... | 'AndSilence' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/module/test_utilmoddeprecate.py | test_deprecate_module_attr | assert | string_literal | 57 | def test_deprecate_module_attr() -> None:
'''
Test the
:func:`beartype._util.module.utilmoddeprecate.deprecate_module_attr` function.
'''
# ..................{ IMPORTS }..................
# Defer test-specific imports.
from beartype._util.module.utilmoddeprecate i... | 'whose veil' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextmunge.py | test_suffix_str_unless_suffixed | assert | string_literal | 23 | def test_suffix_str_unless_suffixed():
'''
Test the
:func:`beartype._util.text.utiltextmunge.suffix_str_unless_suffixed`
function.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.text.utiltextmunge impor... | "somefile.py" | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a10_data/code/test_datacodeindent.py | test_data_indent_level_to_code | assert | string_literal | 18 | def test_data_indent_level_to_code() -> None:
'''
Test the :obj:`beartype._data.code.datacodeindent.INDENT_LEVEL_TO_CODE`
dictionary singleton.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._data.code.datacodein... | ' ' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/error/test_utilerrget.py | test_get_name_error_attr_name | assert | string_literal | 21 | def test_get_name_error_attr_name() -> None:
'''
Test the
:func:`beartype._util.error.utilerrget.get_name_error_attr_name` getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.error.utilerrget import get_... | 'undefined_attr' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/test_codenoop.py | test_decor_noop_unhinted_sync | assert | string_literal | 27 | def test_decor_noop_unhinted_sync() -> None:
'''
Test that the :func:`beartype.beartype` decorator efficiently reduces to a
noop on **unannotated synchronous callables** (i.e., callables with *no*
annotations declared with the ``def`` rather than ``async def`` keyword).
'''
# Defer test-specifi... | 'WAAAGH!!HGAAAW' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/typing/test_typingpep544.py | test_typingpep544_superclass | assert | string_literal | 26 | def test_typingpep544_superclass() -> None:
'''
Test the public :class:`beartype.typing.Protocol` superclass.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.typing import (
Protocol as ProtocolFast,
T... | 'beartype.typing' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncframe.py | test_iter_frames | assert | string_literal | 23 | def test_iter_frames() -> None:
'''
Test the
:func:`beartype._util.func.utilfuncframe.iter_frames` iterator.
'''
# Defer test-specific imports.
from beartype._util.func.utilfunccodeobj import get_func_codeobj
from beartype._util.func.utilfuncframe import iter_frames
# For each stack fr... | 'test_iter_frames' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/a80_nonpep/test_codenonpep.py | test_nonpep_pass_param_tuple | assert | string_literal | 18 | def test_nonpep_pass_param_tuple() -> None:
'''
Test type-checking for a function call successfully passed a parameter
annotated with a PEP-noncompliant tuple union.
'''
# Import this decorator.
from beartype import beartype
# Function to be type-checked. For completeness, test both an act... | 'Norn-QueenBehemoth' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/a80_nonpep/test_codenonpep.py | test_nonpep_pass_param_tuple | assert | string_literal | 19 | def test_nonpep_pass_param_tuple() -> None:
'''
Test type-checking for a function call successfully passed a parameter
annotated with a PEP-noncompliant tuple union.
'''
# Import this decorator.
from beartype import beartype
# Function to be type-checked. For completeness, test both an act... | 'Carnifex3735928559' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/data/pep/pep695/data_pep695util.py | unit_test_iter_hint_pep695_forwardrefs | assert | string_literal | 87 | def unit_test_is_hint_pep695_subscripted() -> None:
'''
Test the private
:mod:`beartype._util.hint.pep.proposal.pep695.is_hint_pep695_subscripted`
tester.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.... | 'ItsBurstingBurthen' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/data/pep/pep695/data_pep695util.py | unit_test_iter_hint_pep695_forwardrefs | assert | string_literal | 115 | def unit_test_is_hint_pep695_subscripted() -> None:
'''
Test the private
:mod:`beartype._util.hint.pep.proposal.pep695.is_hint_pep695_subscripted`
tester.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.... | 'ImpatientlyEndured' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/data/pep/pep695/data_pep695util.py | unit_test_iter_hint_pep695_forwardrefs | assert | string_literal | 129 | def unit_test_is_hint_pep695_subscripted() -> None:
'''
Test the private
:mod:`beartype._util.hint.pep.proposal.pep695.is_hint_pep695_subscripted`
tester.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.... | 'AtTheSoundHeTurned' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/cls/test_utilclsmake.py | test_make_type | assert | string_literal | 54 | def test_make_type() -> None:
'''
Test the :func:`beartype._util.cls.utilclsmake.make_type` tester.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roarexc import _BeartypeUtilTypeException
from beartype._ut... | 'of divine philosophy' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/cls/test_utilclsmake.py | test_make_type | assert | string_literal | 48 | def test_make_type() -> None:
'''
Test the :func:`beartype._util.cls.utilclsmake.make_type` tester.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roarexc import _BeartypeUtilTypeException
from beartype._ut... | 'its_choicest.impulses' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/test_utilobject.py | test_get_object_basename_scoped | assert | string_literal | 27 | def test_get_object_basename_scoped() -> None:
'''
Test the :func:`beartype._util.utilobject.get_object_basename_scoped`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roarexc import _BeartypeUtilOb... | 'closure_factory.closure' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/a90_pep/test_decorpep563.py | test_pep563_module | assert | string_literal | 52 | from beartype_test._util.mark.pytskip import (
# skip,
skip_if_pypy,
skip_if_python_version_less_than,
skip_if_python_version_greater_than_or_equal_to,
)
def test_pep563_module() -> None:
'''
Test module-scoped :pep:`563` support implemented in the
:func:`beartype.beartype` decorator.
'... | 'Notch. Player of games.' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextmunge.py | test_replace_str_substrs | assert | string_literal | 29 | def test_replace_str_substrs():
'''
Test the :func:`beartype._util.text.utiltextmunge.replace_str_substrs`
function.
'''
# Defer test-specific imports.
from beartype._util.text.utiltextmunge import replace_str_substrs
from beartype.roar._roarexc import _BeartypeUtilTextException
from py... | "I think, therefore I am." | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a20_code/snip/test_codesnipcls.py | test_pith_index_to_var_name | assert | string_literal | 17 | def test_pith_index_to_var_name() -> None:
'''
Test the :obj:`beartype._check.code.snip.codesnipcls.PITH_INDEX_TO_VAR_NAME`
dictionary singleton.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._check.code.snip.co... | f'{VAR_NAME_PITH_PREFIX}1' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a20_code/snip/test_codesnipcls.py | test_pith_index_to_var_name | assert | string_literal | 18 | def test_pith_index_to_var_name() -> None:
'''
Test the :obj:`beartype._check.code.snip.codesnipcls.PITH_INDEX_TO_VAR_NAME`
dictionary singleton.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._check.code.snip.co... | f'{VAR_NAME_PITH_PREFIX}2' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/test_codenoop.py | test_decor_noop_unhinted_async | assert | string_literal | 26 | async def test_decor_noop_unhinted_async() -> None:
'''
Test that the :func:`beartype.beartype` decorator efficiently reduces to a
noop on **unannotated asynchronous callables** (i.e., callables with *no*
annotations declared with the ``async def`` rather than ``def`` keywords).
'''
# Defer tes... | 'Blood Runs...Anger Rises' | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/a00_cache/map/test_utilmaplru.py | test_lrucachestrong_one_pass | assert | numeric_literal | 24 | from pytest import raises
from beartype.roar._roarexc import _BeartypeUtilCacheLruException
def test_lrucachestrong_one_pass() -> None:
"""
Test successful usage of the
:func:`beartype._util.cache.map.utilmaplru.CacheLruStrong` class against an
LRU cache caching at most one key-value pair.
"""
... | 0 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/a00_cache/map/test_utilmaplru.py | test_lrucachestrong_one_pass | assert | numeric_literal | 29 | from pytest import raises
from beartype.roar._roarexc import _BeartypeUtilCacheLruException
def test_lrucachestrong_one_pass() -> None:
"""
Test successful usage of the
:func:`beartype._util.cache.map.utilmaplru.CacheLruStrong` class against an
LRU cache caching at most one key-value pair.
"""
... | 1 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/a00_cache/map/test_utilmaplru.py | test_lrucachestrong_two_pass | assert | numeric_literal | 37 | from pytest import raises
from beartype.roar._roarexc import _BeartypeUtilCacheLruException
def test_lrucachestrong_two_pass() -> None:
"""
Test successful usage of the
:func:`beartype._util.cache.map.utilmaplru.CacheLruStrong` class against an
LRU cache caching at most two key-value pairs.
"""
... | 2 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/error/test_utilerrwarn.py | test_reissue_warnings_placeholder | assert | numeric_literal | 112 | def test_reissue_warnings_placeholder() -> None:
'''
Test the
:func:`beartype._util.error.utilerrwarn.reissue_warnings_placeholder`
function.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.error.utilerr... | 4 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/arg/test_utilfuncargiter.py | test_iter_func_args | assert | numeric_literal | 42 | def test_iter_func_args() -> None:
'''
Test the
:func:`beartype._util.func.arg.utilfuncargtest.iter_func_args` generator.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roarexc import _BeartypeUtilCallableE... | 0 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/arg/test_utilfuncarglen.py | test_get_func_args_len_flexible | assert | numeric_literal | 37 | def test_get_func_args_len_flexible() -> None:
'''
Test the
:func:`beartype._util.func.arg.utilfuncarglen.get_func_args_flexible_len`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roarexc impor... | 0 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/arg/test_utilfuncarglen.py | test_get_func_args_len_flexible | assert | numeric_literal | 39 | def test_get_func_args_len_flexible() -> None:
'''
Test the
:func:`beartype._util.func.arg.utilfuncarglen.get_func_args_flexible_len`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roarexc impor... | 1 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/arg/test_utilfuncarglen.py | test_get_func_args_len_flexible | assert | numeric_literal | 40 | def test_get_func_args_len_flexible() -> None:
'''
Test the
:func:`beartype._util.func.arg.utilfuncarglen.get_func_args_flexible_len`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roarexc impor... | 2 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncmake.py | test_make_func | assert | numeric_literal | 114 | AND_SEE_THE_GREAT_ACHILLES = 'whom we knew'
def test_make_func(capsys) -> None:
'''
Test the :func:`beartype._util.func.utilfuncmake.make_func` function.
Parameters
----------
capsys
:mod:`pytest` fixture enabling standard output and error to be reliably
captured and tested against... | 2 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncmake.py | test_make_func | assert | numeric_literal | 123 | AND_SEE_THE_GREAT_ACHILLES = 'whom we knew'
def test_make_func(capsys) -> None:
'''
Test the :func:`beartype._util.func.utilfuncmake.make_func` function.
Parameters
----------
capsys
:mod:`pytest` fixture enabling standard output and error to be reliably
captured and tested against... | 4 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextrepr.py | test_represent_object | assert | numeric_literal | 68 | def test_represent_object() -> None:
'''
Test the :func:`beartype._util.text.utiltextrepr.represent_object`
function.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.text.utiltextrepr import represent_object... | 2 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/door/a00_type/test_door_typehint.py | test_door_typehint_len | assert | numeric_literal | 17 | from beartype_test._util.mark.pytmark import ignore_warnings
def test_door_typehint_len():
'''
Test the :meth:`beartype.door.TypeHint.__len__` dunder method.
'''
# Defer test-specific imports.
from beartype.door import TypeHint
from beartype.typing import (
Tuple,
Union,
)
... | 0 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/door/a00_type/test_door_typehint.py | test_door_typehint_len | assert | numeric_literal | 18 | from beartype_test._util.mark.pytmark import ignore_warnings
def test_door_typehint_len():
'''
Test the :meth:`beartype.door.TypeHint.__len__` dunder method.
'''
# Defer test-specific imports.
from beartype.door import TypeHint
from beartype.typing import (
Tuple,
Union,
)
... | 2 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/vale/_is/test_valeis.py | test_api_vale_is_pass | assert | numeric_literal | 151 | def test_api_vale_is_pass() -> None:
'''
Test successful usage of the :mod:`beartype.vale.Is` factory.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype import beartype
from beartype._util.func.utilfuncmake import m... | 4 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/vale/_is/test_valeis.py | test_api_vale_is_pass | assert | numeric_literal | 152 | def test_api_vale_is_pass() -> None:
'''
Test successful usage of the :mod:`beartype.vale.Is` factory.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype import beartype
from beartype._util.func.utilfuncmake import m... | 2 | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/arg/test_utilfuncargget.py | test_get_func_arg_names | assert | collection | 26 | def test_get_func_arg_names() -> None:
'''
Test the
:func:`beartype._util.func.arg.utilfuncargget.get_func_arg_names`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roarexc import _BeartypeUtilC... | () | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncframe.py | test_iter_frames | assert | collection | 40 | def test_iter_frames() -> None:
'''
Test the
:func:`beartype._util.func.utilfuncframe.iter_frames` iterator.
'''
# Defer test-specific imports.
from beartype._util.func.utilfunccodeobj import get_func_codeobj
from beartype._util.func.utilfuncframe import iter_frames
# For each stack fr... | () | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncscope.py | test_get_func_locals | assert | collection | 129 | def attach_func_locals(**kwargs) -> 'collections.abc.Callable':
'''
Decorator attaching the local scope of the parent callable declaring the
passed callable to a new ``func_locals`` attribute of the passed callable.
Parameters
----------
This decorator forwards all passed keyword parameters as ... | {} | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/proposal/test_utilpep585.py | test_get_hint_pep585_generic_typevars | assert | collection | 54 | def test_get_hint_pep585_generic_typevars(hints_pep_meta) -> None:
'''
Test the
:func:`beartype._util.hint.pep.proposal.pep585.get_hint_pep585_generic_typevars`
function.
Parameters
----------
hints_pep_meta : List[beartype_test.a00_unit.data.hint.util.data_hintmetacls.HintPepMetadata]
... | () | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/test_a00_utilpepget.py | test_get_hint_pep_args | assert | collection | 41 | def test_get_hint_pep_args(hints_pep_meta) -> None:
'''
Test the
:func:`beartype._util.hint.pep.utilpepget.get_hint_pep_args`
getter.
Parameters
----------
hints_pep_meta : List[beartype_test.a00_unit.data.hint.util.data_hintmetacls.HintPepMetadata]
List of PEP-compliant type hint m... | () | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/kind/map/test_utilmapset.py | test_merge_mappings_two | assert | collection | 19 | def test_merge_mappings_two() -> None:
'''
Test the :func:`beartype._util.kind.map.utilmapset.merge_mappings` function
passed exactly two mappings.
'''
# Defer test-specific imports.
from beartype._util.kind.map.utilmapset import merge_mappings
from beartype_test.a00_unit.data.kind.data_kin... | {} | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/conf/test_confcls.py | test_conf_dataclass | assert | collection | 156 | def test_conf_dataclass() -> None:
'''
Test the public :func:`beartype.BeartypeConf` class.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype import (
BeartypeConf,
BeartypeDecorationPosition,
Be... | () | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/test_api_cave.py | test_api_cave_tuple_core | assert | collection | 118 | import argparse, functools, re, sys, weakref
from beartype_test._util.mark.pytskip import skip_if_pypy, skip_unless_package
from collections import deque
from collections.abc import Iterable
from decimal import Decimal
from enum import Enum
from fractions import Fraction
def _we_were_dreamers_dreaming_greatly_in_the_m... | () | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextversion.py | test_convert_str_version_to_tuple | assert | collection | 18 | def test_convert_str_version_to_tuple() -> None:
'''
Test the
:func:`beartype._util.text.utiltextversion.convert_str_version_to_tuple`
exception-raiser.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._ro... | (0,) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextversion.py | test_convert_str_version_to_tuple | assert | collection | 22 | def test_convert_str_version_to_tuple() -> None:
'''
Test the
:func:`beartype._util.text.utiltextversion.convert_str_version_to_tuple`
exception-raiser.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._ro... | (26,) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/proposal/pep484/test_utilpep484typevar.py | test_get_hint_pep484_typevars_to_hints | assert | collection | 36 | def test_get_hint_pep484_typevars_to_hints() -> None:
'''
Test the
:func:`beartype._util.hint.pep.proposal.pep484.pep484typevar._get_hint_pep484_typevars_to_hints`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
fro... | {S: int} | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/py/test_utilpyword.py | test_word_size | assert | collection | 11 | def test_word_size() -> None:
'''
Test the :func:`beartype._util.py.utilpyword.WORD_SIZE` constant.
'''
# Defer test-specific imports.
from beartype._util.py.utilpyword import WORD_SIZE
# Assert the active Python interpreter to be either 32- or 64-bit.
assert WORD_SIZE in | {32, 64} | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a20_code/test_codescope.py | test_add_func_scope_types | assert | collection | 74 | def test_add_func_scope_types() -> None:
'''
Test the
:func:`beartype._check.code.codescope.add_func_scope_types` adder.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar import (
BeartypeDecorHintNonpe... | (Class,) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/api/standard/test_utilapifunctools.py | test_get_func_functools_partial_args | assert | collection | 23 | def test_get_func_functools_partial_args() -> None:
'''
Test the
:func:`beartype._util.api.standard.utilfunctools.get_func_functools_partial_args`
getter.
'''
# Defer test-specific imports.
from beartype._util.api.standard.utilfunctools import (
get_func_functools_partial_args)
... | ((2,), {}) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/proposal/pep484585/test_utilpep484585.py | test_get_hint_pep484585_args | assert | collection | 30 | def test_get_hint_pep484585_args() -> None:
'''
Test the
:func:`beartype._util.hint.pep.proposal.pep484585.pep484585.get_hint_pep484585_args`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar import... | (str, int) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextversion.py | test_convert_str_version_to_tuple | assert | collection | 32 | def test_convert_str_version_to_tuple() -> None:
'''
Test the
:func:`beartype._util.text.utiltextversion.convert_str_version_to_tuple`
exception-raiser.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._ro... | (0, 26, 5,) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.