Organize top-level imports for lalib
- make `GF2`, `one`, and `zero`, defined in the `lalib.elements.gf2` module, available as top-level imports for the `lalib` package via `from lalib import *` - provide some code snippets in the package's docstring - test the star import
This commit is contained in:
parent
3cfc0db136
commit
62b25f66d9
2 changed files with 45 additions and 0 deletions
18
tests/test_top_level_imports.py
Normal file
18
tests/test_top_level_imports.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
"""Test top-level imports for `lalib`."""
|
||||
|
||||
import lalib as top_level
|
||||
|
||||
|
||||
def test_top_level_imports():
|
||||
"""Verify `from lalib import *` works."""
|
||||
environment = {}
|
||||
|
||||
exec("...", environment, environment) # noqa: S102
|
||||
defined_vars_before = set(environment)
|
||||
|
||||
exec("from lalib import *", environment, environment) # noqa: S102
|
||||
defined_vars_after = set(environment)
|
||||
|
||||
new_vars = defined_vars_after - defined_vars_before
|
||||
|
||||
assert new_vars == set(top_level.__all__)
|
||||
Loading…
Add table
Add a link
Reference in a new issue