LAL  7.5.0.1-bede9b2
test_python_scripts Namespace Reference

Functions

def read_exclude_file (source)
 Read all excluded file paths from the given source file. More...
 
def parse_pybin_scripts (path, var="pybin_scripts")
 Yield script names from the relevant Makefile list variable. More...
 
def find_scripts (path)
 Yields the script names of python files in the given directory. More...
 
def test_help (script)
 Test that <script> --help can be executed for the named script. More...
 

Variables

string PACKAGE = "lal"
 
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 BINDIR = BUILDDIR
 
tuple EXCLUDEFILE = SRCDIR / "exclude-scripts.txt"
 
def EXCLUDE = read_exclude_file(SRCDIR / "exclude-scripts.txt")
 
 SCRIPTS = sorted(parse_pybin_scripts(BINDIR / "Makefile"))
 
list args = sys.argv[1:] or DEFAULT_PYTEST_ARGUMENTS
 
 code = pytest.main(args=[__file__] + args)
 

Function Documentation

◆ read_exclude_file()

def test_python_scripts.read_exclude_file (   source)

Read all excluded file paths from the given source file.

Definition at line 61 of file test_python_scripts.py.

◆ parse_pybin_scripts()

def test_python_scripts.parse_pybin_scripts (   path,
  var = "pybin_scripts" 
)

Yield script names from the relevant Makefile list variable.

Definition at line 78 of file test_python_scripts.py.

◆ find_scripts()

def test_python_scripts.find_scripts (   path)

Yields the script names of python files in the given directory.

This is just the file name with the trailing .py extension removed.

Definition at line 103 of file test_python_scripts.py.

◆ test_help()

def test_python_scripts.test_help (   script)

Test that <script> --help can be executed for the named script.

Definition at line 130 of file test_python_scripts.py.

Variable Documentation

◆ PACKAGE

string test_python_scripts.PACKAGE = "lal"

Definition at line 31 of file test_python_scripts.py.

◆ CONDA_BUILD_TEST

string test_python_scripts.CONDA_BUILD_TEST = "TEST"

Definition at line 34 of file test_python_scripts.py.

◆ DEFAULT_PYTEST_ARGUMENTS

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

Definition at line 37 of file test_python_scripts.py.

◆ HERE

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

Definition at line 44 of file test_python_scripts.py.

◆ BUILDDIR

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

Definition at line 45 of file test_python_scripts.py.

◆ SRCDIR

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

Definition at line 46 of file test_python_scripts.py.

◆ TOPBUILDDIR

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

Definition at line 47 of file test_python_scripts.py.

◆ BINDIR

tuple test_python_scripts.BINDIR = BUILDDIR

Definition at line 49 of file test_python_scripts.py.

◆ EXCLUDEFILE

tuple test_python_scripts.EXCLUDEFILE = SRCDIR / "exclude-scripts.txt"

Definition at line 54 of file test_python_scripts.py.

◆ EXCLUDE

def test_python_scripts.EXCLUDE = read_exclude_file(SRCDIR / "exclude-scripts.txt")

Definition at line 115 of file test_python_scripts.py.

◆ SCRIPTS

test_python_scripts.SCRIPTS = sorted(parse_pybin_scripts(BINDIR / "Makefile"))

Definition at line 117 of file test_python_scripts.py.

◆ args

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

Definition at line 148 of file test_python_scripts.py.

◆ code

test_python_scripts.code = pytest.main(args=[__file__] + args)

Definition at line 149 of file test_python_scripts.py.