MCPcopy Index your code
hub / github.com/numpy/numpy / test_warn_len_equal_call_scenarios

Function test_warn_len_equal_call_scenarios

numpy/testing/tests/test_utils.py:1733–1758  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1731
1732
1733def test_warn_len_equal_call_scenarios():
1734 # assert_warn_len_equal is called under
1735 # varying circumstances depending on serial
1736 # vs. parallel test scenarios; this test
1737 # simply aims to probe both code paths and
1738 # check that no assertion is uncaught
1739
1740 # parallel scenario -- no warning issued yet
1741 class mod:
1742 pass
1743
1744 mod_inst = mod()
1745
1746 assert_warn_len_equal(mod=mod_inst,
1747 n_in_context=0)
1748
1749 # serial test scenario -- the __warningregistry__
1750 # attribute should be present
1751 class mod:
1752 def __init__(self):
1753 self.__warningregistry__ = {'warning1': 1,
1754 'warning2': 2}
1755
1756 mod_inst = mod()
1757 assert_warn_len_equal(mod=mod_inst,
1758 n_in_context=2)
1759
1760
1761def _get_fresh_mod():

Callers

nothing calls this directly

Calls 2

assert_warn_len_equalFunction · 0.85
modClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…