cwltest.plugin

Discovers CWL test files and converts them to pytest.Items.

Exceptions

CWLTestException

custom exception for error reporting.

Classes

TestRunner

Protocol to type-check test runner functions via the pluggy hook.

CWLItem

A CWL test Item.

CWLYamlFile

A CWL test file.

Functions

pytest_addoption(parser)

Add our options to the pytest command line.

pytest_collect_file(file_path, parent)

Is this file for us.

pytest_configure(config)

Store the raw tests and the test results.

pytest_sessionfinish(session)

Generate badges.

pytest_addhooks(pluginmanager)

Register our cwl hooks.

Module Contents

class cwltest.plugin.TestRunner

Bases: Protocol

Inheritance diagram of cwltest.plugin.TestRunner

Protocol to type-check test runner functions via the pluggy hook.

__call__(config, processfile, jobfile)

Type signature for pytest_cwl_execute_test hook results.

Parameters:
Return type:

list[dict[str, Any] | None]

exception cwltest.plugin.CWLTestException

Bases: Exception

Inheritance diagram of cwltest.plugin.CWLTestException

custom exception for error reporting.

class cwltest.plugin.CWLItem(name, parent, spec)

Bases: pytest.Item

Inheritance diagram of cwltest.plugin.CWLItem

A CWL test Item.

Parameters:
  • name (str)

  • parent (Optional[_pytest.nodes.Node])

  • spec (dict[str, Any])

spec
runtest()

Execute using cwltest.

Return type:

None

repr_failure(excinfo, style=None)

Document failure reason.

Called when self.runtest() raises an exception.

Parameters:
  • excinfo (pytest.ExceptionInfo[BaseException])

  • style (Optional[_pytest._code.code.TracebackStyle])

Return type:

str

reportinfo()

Status report.

Return type:

tuple[Union[os.PathLike[str], str], int | None, str]

class cwltest.plugin.CWLYamlFile(fspath=None, path_or_parent=None, path=None, name=None, parent=None, config=None, session=None, nodeid=None)

Bases: pytest.File

Inheritance diagram of cwltest.plugin.CWLYamlFile

A CWL test file.

Parameters:
  • fspath (_pytest.compat.LEGACY_PATH | None)

  • path_or_parent (pathlib.Path | Node | None)

  • path (pathlib.Path | None)

  • name (str | None)

  • parent (Node | None)

  • config (_pytest.config.Config | None)

  • session (_pytest.main.Session | None)

  • nodeid (str | None)

collect()

Load the cwltest file and yield parsed entries.

Return type:

collections.abc.Iterator[CWLItem]

cwltest.plugin.pytest_addoption(parser)

Add our options to the pytest command line.

Parameters:

parser (pytest.Parser)

Return type:

None

cwltest.plugin.pytest_collect_file(file_path, parent)

Is this file for us.

Parameters:
Return type:

pytest.Collector | None

cwltest.plugin.pytest_configure(config)

Store the raw tests and the test results.

Parameters:

config (pytest.Config)

Return type:

None

cwltest.plugin.pytest_sessionfinish(session)

Generate badges.

Parameters:

session (pytest.Session)

Return type:

None

cwltest.plugin.pytest_addhooks(pluginmanager)

Register our cwl hooks.

Parameters:

pluginmanager (pytest.PytestPluginManager)

Return type:

None