Undocumented
Function | check |
Returns a mapping of all objects with the wrong __module__ attribute. |
Function | is |
Check if this needs to be considered. |
Function | test |
Test that we don't add anything that looks like a new public module by accident. Check is based on filenames. |
Function | test |
Method checking all objects. The pkgutil-based method in test_all_modules_are_expected does not catch imports into a namespace, only filenames. So this test is more thorough, and checks this like: |
Function | test |
Check that all submodules listed higher up in this file can be imported |
Function | test |
Entry point for Array API implementation can be found with importlib and returns the numpy.array_api namespace. |
Function | test |
Assert that output of dir has only one "testing/tester" attribute without duplicate |
Function | test |
Make sure we can actually use the modules we lazy load. |
Function | test_ |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Function | test |
Undocumented |
Constant | PRIVATE |
Undocumented |
Constant | PUBLIC |
Undocumented |
Constant | PUBLIC |
Undocumented |
Constant | SKIP |
Undocumented |
Constant | SKIP |
Undocumented |
Test that we don't add anything that looks like a new public module by accident. Check is based on filenames.
Method checking all objects. The pkgutil-based method in
test_all_modules_are_expected
does not catch imports into a namespace,
only filenames. So this test is more thorough, and checks this like:
import .lib.scimath as emath
To check if something in a module is (effectively) public, one can check if
there's anything in that namespace that's a public function/object but is
not exposed in a higher-level namespace. For example for a numpy.lib
submodule:
mod = np.lib.mixins for obj in mod.__all__: if obj in np.__all__: continue elif obj in np.lib.__all__: continue else: print(obj)
Check that all submodules listed higher up in this file can be imported
Note that if a PRIVATE_BUT_PRESENT_MODULES entry goes missing, it may simply need to be removed from the list (deprecation may or may not be needed - apply common sense).
def test_array_api_entry_point(): (source) ¶
Entry point for Array API implementation can be found with importlib and returns the numpy.array_api namespace.
@pytest.mark.parametrize(
def test_import_lazy_import(name): (source) ¶
Make sure we can actually use the modules we lazy load.
While not exported as part of the public API, it was accessible. With the use of __getattr__ and __dir__, this isn't always true It can happen that an infinite recursion may happen.
This is the only way I found that would force the failure to appear on the badly implemented code.
We also test for the presence of the lazily imported modules in dir
def test_NPY_NO_EXPORT(): (source) ¶
Undocumented
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|