cwltest.plugin

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

Module Contents

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, exitstatus)

Generate badges.

pytest_addhooks(pluginmanager)

Register our cwl hooks.

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:
  • config (cwltest.utils.CWLTestConfig)

  • processfile (str)

  • jobfile (Optional[str])

Return type:

List[Optional[Dict[str, Any]]]

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])

runtest()

Execute using cwltest.

Return type:

None

repr_failure(excinfo, style=None)

Document failure reason.

Called when self.runtest() raises an exception.

Parameters:
  • excinfo (ExceptionInfo[BaseException])

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

Return type:

str

reportinfo()

Status report.

Return type:

Tuple[Union[os.PathLike[str], str], Optional[int], 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 (Optional[_pytest.compat.LEGACY_PATH])

  • path_or_parent (Optional[Union[pathlib.Path, Node]])

  • path (Optional[pathlib.Path])

  • name (Optional[str])

  • parent (Optional[Node])

  • config (Optional[_pytest.config.Config])

  • session (Optional[_pytest.main.Session])

  • nodeid (Optional[str])

collect()

Load the cwltest file and yield parsed entries.

Return type:

Iterator[CWLItem]

cwltest.plugin.pytest_addoption(parser)

Add our options to the pytest command line.

Parameters:

parser (_pytest.config.argparsing.Parser)

Return type:

None

cwltest.plugin.pytest_collect_file(file_path, parent)

Is this file for us.

Parameters:
Return type:

Optional[pytest.Collector]

cwltest.plugin.pytest_configure(config)

Store the raw tests and the test results.

Parameters:

config (_pytest.config.Config)

Return type:

None

cwltest.plugin.pytest_sessionfinish(session, exitstatus)

Generate badges.

Parameters:
  • session (pytest.Session)

  • exitstatus (int)

Return type:

None

cwltest.plugin.pytest_addhooks(pluginmanager)

Register our cwl hooks.

Parameters:

pluginmanager (_pytest.config.PytestPluginManager)

Return type:

None