MCPcopy Create free account
hub / github.com/numpy/numpy / test_warn_len_equal_call_scenarios

Function test_warn_len_equal_call_scenarios

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

Source from the content-addressed store, hash-verified

1260
1261
1262def test_warn_len_equal_call_scenarios():
1263 # assert_warn_len_equal is called under
1264 # varying circumstances depending on serial
1265 # vs. parallel test scenarios; this test
1266 # simply aims to probe both code paths and
1267 # check that no assertion is uncaught
1268
1269 # parallel scenario -- no warning issued yet
1270 class mod:
1271 pass
1272
1273 mod_inst = mod()
1274
1275 assert_warn_len_equal(mod=mod_inst,
1276 n_in_context=0)
1277
1278 # serial test scenario -- the __warningregistry__
1279 # attribute should be present
1280 class mod:
1281 def __init__(self):
1282 self.__warningregistry__ = {'warning1':1,
1283 'warning2':2}
1284
1285 mod_inst = mod()
1286 assert_warn_len_equal(mod=mod_inst,
1287 n_in_context=2)
1288
1289
1290def _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