Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALFrame 3.0.7.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
test_python_imports Namespace Reference

Functions

def read_exclude_file (source)
 
def find_modules (path)
 
def path_to_name (filepath)
 
def test_import (module)
 
def read_exclude_file (source)
 Read all excluded file paths from the given source file. More...
 
def find_modules (path)
 Returns the paths to all python module files. More...
 
def path_to_name (filepath)
 Returns the module name for a given file path. More...
 
def test_import (module)
 Test that the named module can be imported. More...
 

Variables

string PACKAGE
 
string CONDA_BUILD_TEST
 
list DEFAULT_PYTEST_ARGUMENTS
 
 HERE
 
tuple BUILDDIR
 
tuple SRCDIR
 
tuple TOPBUILDDIR
 
tuple EXCLUDEFILE
 
 PYTHONMODDIR = TOPBUILDDIR / "python" / PACKAGE
 
 EXCLUDE
 
list MODULES
 
list args
 
string PACKAGE = "lalframe"
 
string CONDA_BUILD_TEST = "TEST"
 
list DEFAULT_PYTEST_ARGUMENTS
 
 HERE = Path(__file__).parent.absolute()
 
tuple BUILDDIR = (HERE / Path(".")).resolve()
 
tuple SRCDIR = (HERE / Path(".")).resolve()
 
tuple TOPBUILDDIR = (HERE / Path("../..")).resolve()
 
tuple EXCLUDEFILE = SRCDIR / "exclude-modules.txt"
 
 PYTHONMODDIR = Path(import_module(PACKAGE).__path__[0])
 
 EXCLUDE = set(map(path_to_name, read_exclude_file(EXCLUDEFILE)))
 
list MODULES = [path_to_name(x) for x in sorted(find_modules(PYTHONMODDIR))]
 
list args = sys.argv[1:] or DEFAULT_PYTEST_ARGUMENTS
 

Function Documentation

◆ read_exclude_file()

def test_python_imports.read_exclude_file (   source)

Read all excluded file paths from the given source file.

Definition at line 64 of file test_python_imports.py.

◆ find_modules()

def test_python_imports.find_modules (   path)

Returns the paths to all python module files.

Definition at line 81 of file test_python_imports.py.

◆ path_to_name()

def test_python_imports.path_to_name (   filepath)

Returns the module name for a given file path.

‍path_to_name("lal/__init__.py") "lal" path_to_name("lal/module.py") "lal.module"

Definition at line 92 of file test_python_imports.py.

◆ test_import()

def test_python_imports.test_import (   module)

Test that the named module can be imported.

Definition at line 111 of file test_python_imports.py.

Variable Documentation

◆ PACKAGE

string test_python_imports.PACKAGE = "lalframe"

Definition at line 30 of file test_python_imports.py.

◆ CONDA_BUILD_TEST

string test_python_imports.CONDA_BUILD_TEST = "TEST"

Definition at line 33 of file test_python_imports.py.

◆ DEFAULT_PYTEST_ARGUMENTS

list test_python_imports.DEFAULT_PYTEST_ARGUMENTS
Initial value:
1= [
2 "-v",
3 "-rs",
4 "--junit-xml=junit-imports.xml",
5]

Definition at line 36 of file test_python_imports.py.

◆ HERE

test_python_imports.HERE = Path(__file__).parent.absolute()

Definition at line 43 of file test_python_imports.py.

◆ BUILDDIR

tuple test_python_imports.BUILDDIR = (HERE / Path(".")).resolve()

Definition at line 44 of file test_python_imports.py.

◆ SRCDIR

tuple test_python_imports.SRCDIR = (HERE / Path(".")).resolve()

Definition at line 45 of file test_python_imports.py.

◆ TOPBUILDDIR

tuple test_python_imports.TOPBUILDDIR = (HERE / Path("../..")).resolve()

Definition at line 46 of file test_python_imports.py.

◆ EXCLUDEFILE

tuple test_python_imports.EXCLUDEFILE = SRCDIR / "exclude-modules.txt"

Definition at line 49 of file test_python_imports.py.

◆ PYTHONMODDIR

tuple test_python_imports.PYTHONMODDIR = Path(import_module(PACKAGE).__path__[0])

Definition at line 54 of file test_python_imports.py.

◆ EXCLUDE

test_python_imports.EXCLUDE = set(map(path_to_name, read_exclude_file(EXCLUDEFILE)))

Definition at line 101 of file test_python_imports.py.

◆ MODULES

list test_python_imports.MODULES = [path_to_name(x) for x in sorted(find_modules(PYTHONMODDIR))]

Definition at line 102 of file test_python_imports.py.

◆ args

list test_python_imports.args = sys.argv[1:] or DEFAULT_PYTEST_ARGUMENTS

Definition at line 120 of file test_python_imports.py.