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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/misc.py | assertAllClose | assert_* | variable | 273 | import functools
import itertools
import operator
import sys
import getopt
import numpy as np
import scipy as sp
import scipy.linalg as linalg
import scipy.special as special
import scipy.optimize as optimize
import scipy.sparse as sparse
import tempfile as tmp
import unittest
from numpy import testing
def find_se... | B) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/misc.py | assertAllClose | self.assertEqual | func_call | 272 | import functools
import itertools
import operator
import sys
import getopt
import numpy as np
import scipy as sp
import scipy.linalg as linalg
import scipy.special as special
import scipy.optimize as optimize
import scipy.sparse as sparse
import tempfile as tmp
import unittest
from numpy import testing
def find_se... | np.shape(B)) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_linalg.py | test_block_banded_solve | self.assertEqual | variable | 56 | import numpy as np
from .. import misc
from .. import linalg
class TestBandedSolve(misc.TestCase):
def test_block_banded_solve(self):
"""
Test the Gaussian elimination algorithm for block-banded matrices.
"""
#
# Create a block-banded matrix
#
# Number of... | N) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_linalg.py | test_block_banded_solve | self.assertAlmostEqual | numeric_literal | 76 | import numpy as np
from .. import misc
from .. import linalg
class TestBandedSolve(misc.TestCase):
def test_block_banded_solve(self):
"""
Test the Gaussian elimination algorithm for block-banded matrices.
"""
#
# Create a block-banded matrix
#
# Number of... | 1) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_linalg.py | test_block_banded_solve | self.assertEqual | complex_expr | 57 | import numpy as np
from .. import misc
from .. import linalg
class TestBandedSolve(misc.TestCase):
def test_block_banded_solve(self):
"""
Test the Gaussian elimination algorithm for block-banded matrices.
"""
#
# Create a block-banded matrix
#
# Number of... | N-1) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_linalg.py | test_dot | self.assertRaises | variable | 69 | import numpy as np
from .. import misc
from .. import linalg
class TestDot(misc.TestCase):
def test_dot(self):
"""
Test dot product multiple multi-dimensional arrays.
"""
# If no arrays, return 0
self.assertAllClose(linalg.dot(),
0)
# I... | ValueError) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_linalg.py | test_block_banded_solve | self.assertTrue | func_call | 73 | import numpy as np
from .. import misc
from .. import linalg
class TestBandedSolve(misc.TestCase):
def test_block_banded_solve(self):
"""
Test the Gaussian elimination algorithm for block-banded matrices.
"""
#
# Create a block-banded matrix
#
# Number of... | np.allclose(x_true, x)) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_linalg.py | test_block_banded_solve | self.assertTrue | func_call | 70 | import numpy as np
from .. import misc
from .. import linalg
class TestBandedSolve(misc.TestCase):
def test_block_banded_solve(self):
"""
Test the Gaussian elimination algorithm for block-banded matrices.
"""
#
# Create a block-banded matrix
#
# Number of... | np.allclose(invA[-1], invC[i0:, i0:])) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_ceildiv | self.assertEqual | numeric_literal | 20 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestCeilDiv(misc.TestCase):
def test_ceildiv(self):
"""
Test the ceil division
"""
self.assertEqual( | 3) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_ceildiv | self.assertEqual | numeric_literal | 23 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestCeilDiv(misc.TestCase):
def test_ceildiv(self):
"""
Test the ceil division
"""
self.assertEqual(misc.ceildiv(3, 1),
... | 2) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | check_sum_multiply | assert_* | variable | 55 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestSumMultiply(unittest.TestCase):
def check_sum_multiply(self, *shapes, **kwargs):
# The set of arrays
x = list()
for (ind, shape) in enumerate(shapes... | y) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_ceildiv | self.assertEqual | numeric_literal | 32 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestCeilDiv(misc.TestCase):
def test_ceildiv(self):
"""
Test the ceil division
"""
self.assertEqual(misc.ceildiv(3, 1),
... | -2) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_multiply_shapes | self.assertEqual | collection | 33 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestMultiplyShapes(unittest.TestCase):
def test_multiply_shapes(self):
f = lambda *shapes: tuple(misc.multiply_shapes(*shapes))
# Basic test
self.assert... | ()) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_multiply_shapes | self.assertEqual | collection | 19 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestMultiplyShapes(unittest.TestCase):
def test_multiply_shapes(self):
f = lambda *shapes: tuple(misc.multiply_shapes(*shapes))
# Basic test
self.asser... | (6,)) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_multiply_shapes | self.assertEqual | collection | 36 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestMultiplyShapes(unittest.TestCase):
def test_multiply_shapes(self):
f = lambda *shapes: tuple(misc.multiply_shapes(*shapes))
# Basic test
self.assert... | (5,)) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_add_axes | self.assertEqual | collection | 22 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestAddAxes(misc.TestCase):
def test_add_axes(self):
"""
Test the add_axes method.
"""
f = lambda X, **kwargs: np.shape(misc.add_axes(X, **kwargs... | (1,3)) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_add_axes | self.assertEqual | collection | 30 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestAddAxes(misc.TestCase):
def test_add_axes(self):
"""
Test the add_axes method.
"""
f = lambda X, **kwargs: np.shape(misc.add_axes(X, **kwargs... | (3,1)) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_multiply_shapes | self.assertEqual | collection | 23 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestMultiplyShapes(unittest.TestCase):
def test_multiply_shapes(self):
f = lambda *shapes: tuple(misc.multiply_shapes(*shapes))
# Basic test
self.assert... | (24,)) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_add_axes | self.assertEqual | collection | 26 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestAddAxes(misc.TestCase):
def test_add_axes(self):
"""
Test the add_axes method.
"""
f = lambda X, **kwargs: np.shape(misc.add_axes(X, **kwargs... | (1,1,1,3)) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_add_axes | self.assertEqual | collection | 44 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestAddAxes(misc.TestCase):
def test_add_axes(self):
"""
Test the add_axes method.
"""
f = lambda X, **kwargs: np.shape(misc.add_axes(X, **kwargs... | (2,3,4,1)) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_sum_multiply | self.assertRaises | variable | 63 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestSumMultiply(unittest.TestCase):
def check_sum_multiply(self, *shapes, **kwargs):
# The set of arrays
x = list()
for (ind, shape) in enumerate(shapes... | ValueError) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_misc.py | test_is_shape_subset | self.assertTrue | func_call | 17 | import unittest
import warnings
import numpy as np
from scipy.special import psi
from numpy import testing
from .. import misc
class TestBroadcasting(unittest.TestCase):
def test_is_shape_subset(self):
f = misc.is_shape_subset
self.assertTrue( | f( (), () )) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_random.py | test_categorical | self.assertEqual | numeric_literal | 13 | import numpy as np
from .. import misc
from .. import random
class TestCeilDiv(misc.TestCase):
def test_categorical(self):
# Test dummy one category
y = random.categorical([1])
self.assertEqual(y, | 0) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_random.py | test_categorical | self.assertEqual | numeric_literal | 19 | import numpy as np
from .. import misc
from .. import random
class TestCeilDiv(misc.TestCase):
def test_categorical(self):
# Test dummy one category
y = random.categorical([1])
self.assertEqual(y, 0)
# Test multiple categories
y = random.categorical([1,0,0])
self... | 1) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_random.py | test_categorical | self.assertEqual | numeric_literal | 21 | import numpy as np
from .. import misc
from .. import random
class TestCeilDiv(misc.TestCase):
def test_categorical(self):
# Test dummy one category
y = random.categorical([1])
self.assertEqual(y, 0)
# Test multiple categories
y = random.categorical([1,0,0])
self... | 2) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_random.py | test | self.assertTrue | func_call | 165 | import numpy as np
from .. import misc
from .. import random
class TestAlphaBetaRecursion(misc.TestCase):
def test(self):
"""
Test the results of alpha-beta recursion for Markov chains
"""
np.seterr(divide='ignore')
# Deterministic oscillator
p0 = np.array([1.0, ... | np.all(~np.isnan(g))) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_random.py | test | self.assertTrue | func_call | 161 | import numpy as np
from .. import misc
from .. import random
class TestAlphaBetaRecursion(misc.TestCase):
def test(self):
"""
Test the results of alpha-beta recursion for Markov chains
"""
np.seterr(divide='ignore')
# Deterministic oscillator
p0 = np.array([1.0, ... | np.all(~np.isnan(z0))) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
bayespy/bayespy | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | train | train | bayespy/utils/tests/test_random.py | test | self.assertTrue | func_call | 163 | import numpy as np
from .. import misc
from .. import random
class TestAlphaBetaRecursion(misc.TestCase):
def test(self):
"""
Test the results of alpha-beta recursion for Markov chains
"""
np.seterr(divide='ignore')
# Deterministic oscillator
p0 = np.array([1.0, ... | np.all(~np.isnan(zz))) | f8f0fb5bf60b036b94e2f168ceafd6d37db65475 | 92 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/proposal/test_utilpep612.py | test_get_hint_pep612_paramspec | assert | variable | 31 | def test_get_hint_pep612_paramspec() -> None:
'''
Test the private
:mod:`beartype._util.hint.pep.proposal.pep612.get_hint_pep612_paramspec`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.api.sta... | P | 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_compare_fail | assert | variable | 22 | from beartype_test._util.mark.pytmark import ignore_warnings
def test_door_typehint_compare_fail() -> None:
'''
Test unsuccessful usage the rich comparison dunder methods defined by the
:class:`beartype.door.TypeHint` class.
'''
# Defer test-specific imports.
from beartype.door import TypeHint... | b | 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_typevar_bound_or_none | assert | variable | 26 | def test_get_hint_pep484_typevar_bound_or_none() -> None:
'''
Test the
:func:`beartype._util.hint.pep.proposal.pep484.pep484typevar.get_hint_pep484_typevar_bound_or_none`
tester.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
... | int | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/proposal/test_utilpep484604.py | test_make_hint_pep484604_union | assert | variable | 24 | def test_make_hint_pep484604_union() -> None:
'''
Test the private
:mod:`beartype._util.hint.pep.proposal.pep484604.make_hint_pep484604_union`
factory.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar impo... | int | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/proposal/test_utilpep557.py | test_get_hint_pep557_initvar_arg | assert | variable | 17 | def test_get_hint_pep557_initvar_arg() -> None:
'''
Test usage of the private
:mod:`beartype._util.hint.pep.proposal.pep557.get_hint_pep557_initvar_arg`
getter.
'''
# Defer test-specific imports.
from beartype.roar import BeartypeDecorHintPep557Exception
from beartype._util.hint.pep.pro... | str | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/module/test_utilmodimport.py | test_import_module_attr_or_sentinel | assert | variable | 35 | def test_import_module_attr_or_sentinel() -> None:
'''
Test the
:func:`beartype._util.module.utilmodget.import_module_attr_or_sentinel`
importer.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar import Bea... | int | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/module/test_utilmodimport.py | test_import_module_attr_or_sentinel | assert | variable | 52 | def test_import_module_attr_or_sentinel() -> None:
'''
Test the
:func:`beartype._util.module.utilmodget.import_module_attr_or_sentinel`
importer.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar import Bea... | str | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/plug/test_plugmixin.py | test_beartypehintable | assert | variable | 31 | def test_beartypehintable() -> None:
'''
Test the :class:`beartype.plug._plughintable.BeartypeHintable` mixin.
'''
# .....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.plug import BeartypeHintable
from pytest import raises... | str | 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_type | assert | variable | 39 | def test_add_func_scope_type() -> None:
'''
Test the
:func:`beartype._check.code.codescope.add_func_scope_type` adder.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar import BeartypeDecorHintPep3119Exception
... | cls | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a40_convert/a00_reduce/test_redhint.py | test_reduce_hint | assert | variable | 49 | def test_reduce_hint() -> None:
'''
Test the private
:func:`beartype._check.convert._reduce.redhint.reduce_hint` reducer.
'''
# ..................{ IMPORTS }..................
# Defer test-specific imports.
from beartype.roar import (
BeartypeDecorHintNonp... | int | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a40_convert/a00_reduce/test_redhint.py | test_reduce_hint | assert | variable | 110 | def test_reduce_hint() -> None:
'''
Test the private
:func:`beartype._check.convert._reduce.redhint.reduce_hint` reducer.
'''
# ..................{ IMPORTS }..................
# Defer test-specific imports.
from beartype.roar import (
BeartypeDecorHintNonp... | str | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a40_convert/test_convcoerce.py | test_coerce_func_hint_root | assert | variable | 30 | def test_coerce_func_hint_root() -> None:
'''
Test the private
:func:`beartype._check.convert._convcoerce.coerce_func_hint_root`
coercer.
'''
# ..................{ IMPORTS }..................
# Defer test-specific imports.
from beartype import BeartypeConf
... | str | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a40_convert/test_convcoerce.py | test_coerce_hint_any | assert | variable | 25 | def test_coerce_hint_any() -> None:
'''
Test the private
:func:`beartype._check.convert._convcoerce.coerce_hint_any` coercer.
'''
# ..................{ IMPORTS }..................
# Defer test-specific imports.
from beartype._check.checkcache import clear_checker_... | int | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncscope.py | test_add_func_scope_attr | assert | variable | 110 | 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 ... | attr | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncwrap.py | test_unwrap_func_all | assert | variable | 37 | def test_unwrap_func_all() -> None:
'''
Test the
:func:`beartype._util.func.utilfuncwrap.unwrap_func_all` function.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.func.utilfuncwrap import unwrap_func_all
... | iter | 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 | variable | 24 | 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... | bool | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a90_core/test_utilhintfactory.py | test_typehinttypefactory | assert | variable | 19 | def test_typehinttypefactory() -> None:
'''
Test the :func:`beartype._util.hint.utilhintfactory.TypeHintTypeFactory`
class.
'''
# Defer test-specific imports.
from beartype._util.hint.utilhintfactory import TypeHintTypeFactory
# Arbitrary instance of this factory.
bool_factory = TypeHi... | bool | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/text/test_utiltextlabel.py | test_label_beartypeable_kind | assert | variable | 66 | def test_label_beartypeable_kind() -> None:
'''
Test the :func:`beartype._util.text.utiltextlabel.label_beartypeable_kind`
function.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.text.utiltextlabel import ... | kind | 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_mapping | assert | variable | 61 | from beartype_test._util.mark.pytmark import ignore_warnings
def test_door_typehint_mapping(iter_hints_piths_meta) -> None:
'''
Test that the :meth:`beartype.door.TypeHint.__new__` factory method
successfully creates and returns an instance of a concrete subclass of the
abstract :class:`beartype.door.T... | hint | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a40_api/door/a90_func/test_door_func_infer_hint.py | test_door_infer_hint_numpy | assert | variable | 180 | from beartype_test._util.mark.pytskip import skip_unless_package
def test_door_infer_hint_numpy(
door_cases_infer_hint: 'Iterable[Tuple[object, object]]',
numpy_arrays: 'beartype_test.a00_unit.data.api.data_apinumpy._NumpyArrays',
) -> None:
'''
Test the :func:`beartype.door.infer_hint` function with r... | hint | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a00_metadata/test_metacheck.py | test_metadata_check | assert | variable | 36 | def test_metadata_check() -> None:
'''
Test the :func:`beartype._check.metadata.metacheck.BeartypeCheckMeta`
dataclass.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype import BeartypeConf
from beartype._check.... | conf | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/a90_pep/pep484/test_pep484ref.py | test_pep484_ref_data | assert | variable | 46 | def test_pep484_ref_data() -> None:
'''
Test successful usage of the :func:`beartype.beartype` decorator with
respect to both PEP-compliant and -noncompliant forward references by
importing an external data module declaring these references *before* the
user-defined classes referred to by these refe... | LAKE | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/a90_pep/pep484/test_pep484ref.py | test_pep484_ref_data | assert | variable | 47 | def test_pep484_ref_data() -> None:
'''
Test successful usage of the :func:`beartype.beartype` decorator with
respect to both PEP-compliant and -noncompliant forward references by
importing an external data module declaring these references *before* the
user-defined classes referred to by these refe... | KNOW | 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_hint_ignorable_order | assert | variable | 34 | def test_decor_noop_hint_ignorable_order() -> None:
'''
Test that the :func:`beartype.beartype` decorator efficiently reduces to a
noop on callables annotated with only ignorable type hints in a manner
specifically exercising non-trivial edge cases with respect to ordering
that would be pragmaticall... | gork | 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_hint_ignorable_order | assert | variable | 35 | def test_decor_noop_hint_ignorable_order() -> None:
'''
Test that the :func:`beartype.beartype` decorator efficiently reduces to a
noop on callables annotated with only ignorable type hints in a manner
specifically exercising non-trivial edge cases with respect to ordering
that would be pragmaticall... | mork | 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 | variable | 260 | 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... | pith | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/api/standard/test_utilapityping.py | test_import_typing_attr | assert | variable | 21 | def test_import_typing_attr() -> None:
'''
Test the :func:`beartype._util.api.standard.utiltyping.import_typing_attr`
importer.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roarexc import _BeartypeUti... | Union | 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 | variable | 68 | 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/a60_check/a20_code/test_codescope.py | test_add_func_scope_types | assert | variable | 80 | 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... | types | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a40_convert/a00_reduce/test_redhint.py | test_reduce_hint | assert | variable | 68 | def test_reduce_hint() -> None:
'''
Test the private
:func:`beartype._check.convert._reduce.redhint.reduce_hint` reducer.
'''
# ..................{ IMPORTS }..................
# Defer test-specific imports.
from beartype.roar import (
BeartypeDecorHintNonp... | float | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a80_forward/reference/test_fwdrefmake.py | test_make_forwardref_indexable_subtype | assert | variable | 78 | def test_make_forwardref_indexable_subtype() -> None:
'''
Test the
:func:`beartype._check.forward.reference.fwdrefmake.make_forwardref_indexable_subtype`
factory.
'''
# ....................{ LOCALS }....................
# Defer test-specific imports.
from beartyp... | Class | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/a90_pep/pep484/test_pep484ref.py | test_pep484_ref_data | assert | variable | 45 | def test_pep484_ref_data() -> None:
'''
Test successful usage of the :func:`beartype.beartype` decorator with
respect to both PEP-compliant and -noncompliant forward references by
importing an external data module declaring these references *before* the
user-defined classes referred to by these refe... | WOODS | 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 | variable | 23 | 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... | kaela | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/api/standard/test_utilapifunctools.py | test_unwrap_func_functools_partial_once | assert | variable | 20 | def test_unwrap_func_functools_partial_once() -> None:
'''
Test the
:func:`beartype._util.api.standard.utilfunctools.unwrap_func_functools_partial_once`
unwrapper.
'''
# Defer test-specific imports.
from beartype._util.api.standard.utilfunctools import (
unwrap_func_functools_partia... | divmod | 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_override | assert | variable | 29 | 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_override() -> None:
'''
Test module-scoped :pep:`563` support implemented in the
:func:`beartype.bea... | DREAMS | 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 | variable | 24 | 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... | khorne | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a80_conf/test_decorconf.py | test_decor_conf_is_debug | assert | variable | 43 | def test_decor_conf_is_debug(capsys) -> None:
'''
Test the :func:`beartype.beartype` decorator passed the optional ``conf``
parameter passed the optional ``is_debug`` parameter.
Parameters
----------
capsys
:mod:`pytest` fixture enabling standard output and error to be reliably
... | stdout | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/a00_cache/map/test_utilmapbig.py | test_cacheunboundedstrong | assert | variable | 31 | def test_cacheunboundedstrong() -> None:
"""
Test successful usage of the
:class:`beartype._util.cache.map.utilmapbig.CacheUnboundedStrong` class.
"""
# Defer test-specific imports.
from beartype._util.cache.map.utilmapbig import CacheUnboundedStrong
# Initially empty unbounded cache.
... | VALUE_A | 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 | variable | 89 | 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... | odyssey | 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_reduce_hint_pep484_subscripted_typevar_to_hint | assert | variable | 31 | def test_reduce_hint_pep484_subscripted_typevar_to_hint() -> None:
'''
Test the public
:mod:`beartype._util.hint.pep.proposal.pep484.pep484typevar.reduce_hint_pep484_subscripted_typevar_to_hint`
getter.
'''
# ....................{ IMPORTS }....................
# Defer... | Generic | 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_equals | assert | variable | 51 | from beartype_test._util.mark.pytmark import ignore_warnings
def test_door_typehint_equals(
door_cases_equality: 'Iterable[Tuple[object, object, bool]]') -> None:
'''
Test the :meth:`beartype.door.TypeHint.__equals__` dunder method.
Parameters
----------
door_cases_equality : Iterable[Tuple[ob... | nonhint | 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 | variable | 90 | 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... | types_a | 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 | variable | 91 | 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... | types_b | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a60_check/a40_convert/a00_reduce/test_redhint.py | test_reduce_hint | assert | variable | 72 | def test_reduce_hint() -> None:
'''
Test the private
:func:`beartype._check.convert._reduce.redhint.reduce_hint` reducer.
'''
# ..................{ IMPORTS }..................
# Defer test-specific imports.
from beartype.roar import (
BeartypeDecorHintNonp... | complex | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncfile.py | test_get_func_filename_or_none | assert | variable | 40 | def test_get_func_filename_or_none() -> None:
'''
Test the
:func:`beartype._util.func.utilfuncfile.get_func_filename_or_none` getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.func.utilfuncfile import ... | __file__ | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/proposal/pep484585/generic/test_pep484585genget.py | test_get_hint_pep484585_generic_args_full | assert | variable | 129 | def test_get_hint_pep484585_generic_args_full() -> None:
'''
Test the
:func:`beartype._util.hint.pep.proposal.pep484585.pep484585generic.get_hint_pep484585_generic_args_full`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific impor... | trg_args | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/hint/a00_pep/proposal/test_utilpep593.py | test_get_hint_pep593_metahint | assert | variable | 26 | def test_get_hint_pep593_metahint() -> None:
'''
Test the
:beartype._util.hint.pep.proposal.pep593.get_hint_pep593_metahint`
getter.
'''
# Defer test-specific imports.
from beartype.roar import BeartypeDecorHintPep593Exception
from beartype._util.hint.pep.proposal.pep593 import (
... | metahint | 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 | variable | 62 | 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... | THE_POET | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/module/test_utilmodimport.py | test_import_module_or_none | assert | variable | 16 | def test_import_module_or_none() -> None:
'''
Test the
:func:`beartype._util.module.utilmodget.import_module_or_none` function.
'''
# Defer test-specific imports.
import beartype
from beartype.roar import BeartypeModuleUnimportableWarning
from beartype._util.module.utilmodimport import ... | beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/module/test_utilmodimport.py | test_import_module_attr_or_sentinel | assert | variable | 29 | def test_import_module_attr_or_sentinel() -> None:
'''
Test the
:func:`beartype._util.module.utilmodget.import_module_attr_or_sentinel`
importer.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar import Bea... | SENTINEL | 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_equals | assert | variable | 41 | from beartype_test._util.mark.pytmark import ignore_warnings
def test_door_typehint_equals(
door_cases_equality: 'Iterable[Tuple[object, object, bool]]') -> None:
'''
Test the :meth:`beartype.door.TypeHint.__equals__` dunder method.
Parameters
----------
door_cases_equality : Iterable[Tuple[ob... | IS_EQUAL | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a40_code/a00_api/test_decor_mypy.py | test_decor_mypy_notimplemented | assert | variable | 86 | def test_decor_mypy_notimplemented() -> None:
'''
Test the :func:`beartype.beartype` decorator against :mod:`mypy` compliant
usage of the :data:`NotImplemented` singleton, which is contextually
permissible *only* as an unsubscripted return annotation of binary dunder
methods.
'''
# ........... | the_seas | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/test_decorgodmode.py | test_wrapper_fail_obj_large | assert | variable | 73 | from beartype_test._util.mark.pytskip import skip_unless_godmode
@skip_unless_godmode()
def test_wrapper_fail_obj_large() -> None:
'''
Test unsuccessful usage of a wrapper function dynamically generated by the
:func:`beartype.decorator` decorator to type-check a function accepting a
deeply nested data ... | TIME_MAX | 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 | variable | 49 | 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.
"""
... | lru_cache | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/api/standard/test_utilapityping.py | test_import_typing_attr | assert | variable | 42 | def test_import_typing_attr() -> None:
'''
Test the :func:`beartype._util.api.standard.utiltyping.import_typing_attr`
importer.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roarexc import _BeartypeUti... | Annotated | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncscope.py | test_add_func_scope_attr | assert | variable | 109 | 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 ... | attr_name | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/module/test_utilmodget.py | test_get_object_module_or_none | assert | variable | 17 | def test_get_object_module_or_none() -> None:
'''
Test the :func:`beartype._util.module.utilmodget.get_object_module_or_none`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.module.utilmodget import ... | data_type | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a00_core/test_a00_package.py | test_api_deprecations | assert | none_literal | 34 | def test_api_deprecations() -> None:
'''
Test all deprecated attributes importable from the public APIs of all
subpackages of the :mod:`beartype` package (including itself).
'''
# Defer test-specific imports.
from beartype._util.module.utilmodimport import import_module_attr
from pytest imp... | None | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/api/standard/test_utilapicontextlib.py | test_get_func_contextlib_contextmanager_or_none | assert | none_literal | 44 | def test_get_func_contextlib_contextmanager_or_none() -> None:
'''
Test the
:func:`beartype._util.api.standard.utilcontextlib.get_func_contextlib_contextmanager_or_none`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
... | None | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/cls/test_utilclsget.py | test_get_type_filename_or_none | assert | none_literal | 25 | def test_get_type_filename_or_none() -> None:
'''
Test the
:func:`beartype._util.cls.utilclsget.get_type_filename_or_none` getter.
'''
# Defer test-specific imports.
from beartype._util.cls.utilclsget import get_type_filename_or_none
from beartype_test.a00_unit.data.data_type import (
... | None | 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_name_first_or_none | assert | none_literal | 23 | def test_get_func_arg_name_first_or_none() -> None:
'''
Test the
:func:`beartype._util.func.arg.utilfuncargget.get_func_arg_name_first_or_none`
getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype.roar._roa... | None | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfunccode.py | test_get_func_code_or_none | assert | none_literal | 30 | def test_get_func_code_or_none() -> None:
'''
Test usage of the
:func:`beartype._util.func.utilfunccode.get_func_code_or_none`
function.
'''
# ..................{ IMPORTS }..................
# Defer test-specific imports.
from beartype.roar._roarexc import _Be... | None | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfunccodeobj.py | test_get_func_codeobj_or_none | assert | none_literal | 42 | from functools import wraps
def test_get_func_codeobj_or_none() -> None:
'''
Test the
:func:`beartype._util.func.utilfunccodeobj.get_func_codeobj_or_none`
function.
'''
# ..................{ IMPORTS }..................
# Defer test-specific imports.
from bear... | None | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/func/test_utilfuncfile.py | test_get_func_filename_or_none | assert | none_literal | 36 | def test_get_func_filename_or_none() -> None:
'''
Test the
:func:`beartype._util.func.utilfuncfile.get_func_filename_or_none` getter.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
from beartype._util.func.utilfuncfile import ... | None | 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 | none_literal | 125 | 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... | None | 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_typevar_bound_or_none | assert | none_literal | 23 | def test_get_hint_pep484_typevar_bound_or_none() -> None:
'''
Test the
:func:`beartype._util.hint.pep.proposal.pep484.pep484typevar.get_hint_pep484_typevar_bound_or_none`
tester.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
... | None | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a00_core/test_a90_typing.py | test_api_typing | assert | func_call | 223 | def test_api_typing() -> None:
'''
Test the public API of the :mod:`beartype.meta` submodule.
This test exercises that there exists a one-to-one mapping between public
attributes exported by the :mod:`beartype.typing` and :mod:`typing`
submodules. See the class docstring for relevant commentary.
... | set() | 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_repr | assert | func_call | 15 | from beartype_test._util.mark.pytmark import ignore_warnings
def test_door_typehint_repr() -> None:
'''
Test the :meth:`beartype.door.TypeHint.__repr__` dunder method.
'''
# Defer test-specific imports.
from beartype.door import TypeHint
from beartype.typing import Callable
annotation = C... | repr(hint) | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a70_decor/a80_conf/test_decorconf.py | test_decor_conf | assert | func_call | 21 | def test_decor_conf() -> None:
'''
Test the :func:`beartype.beartype` decorator against the optional ``conf``
parameter agnostic of parameters instantiating that configuration.
'''
# ....................{ IMPORTS }....................
# Defer test-specific imports.
fr... | beartype() | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | v2_extractor_at_anchor |
beartype/beartype | c92e73705cfe484b2e78a1e8e6ec8d835e9c294e | 727 | train | train | beartype_test/a00_unit/a20_util/a00_cache/map/test_utilmapbig.py | test_cacheunboundedstrong | assert | func_call | 47 | def test_cacheunboundedstrong() -> None:
"""
Test successful usage of the
:class:`beartype._util.cache.map.utilmapbig.CacheUnboundedStrong` class.
"""
# Defer test-specific imports.
from beartype._util.cache.map.utilmapbig import CacheUnboundedStrong
# Initially empty unbounded cache.
... | hash(KEY_B) | 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 | 27 | 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(int) | 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 | 21 | 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(non_hint) | 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.