# eric7.Testing.Interfaces.PytestExecutor

Module implementing the executor for the 'pytest' framework.

### Global Attributes

None

### Classes

PytestExecutor | Class implementing the executor for the 'pytest' framework.

### Functions

None

## PytestExecutor

Class implementing the executor for the 'pytest' framework.

### Derived from

TestExecutorBase

### Class Attributes

module
name
runner

### Class Methods

None

### Methods

PytestExecutor | Constructor
__nodeid2testname | Private method to convert a nodeid to a test name.
__normalizeModuleName | Private method to convert a module name reported by pytest to Python conventions.
__processData | Private slot to process the received data.
createArguments | Public method to create the arguments needed to start the test process.
finished | Public method handling the unit test process been finished.
getVersions | Public method to get the test framework version and version information of its installed plugins.
hasCoverage | Public method to get the test framework version and version information of its installed plugins.
start | Public method to start the testing process.

### Static Methods

None

#### PytestExecutor (Constructor)

PytestExecutor(testWidget)

Constructor

testWidget (TestingWidget)
  reference to the unit test widget

#### PytestExecutor.__nodeid2testname

__nodeid2testname(nodeid)

Private method to convert a nodeid to a test name.

nodeid (str)
  nodeid to be converted

Return:
  test name

Return Type:
  str

#### PytestExecutor.__normalizeModuleName

__normalizeModuleName(name)

Private method to convert a module name reported by pytest to Python conventions.

This method strips the extensions '.pyw' and '.py' first and replaces '/' and '\' thereafter.

name (str)
  module name reported by pytest

Return:
  module name iaw. Python conventions

Return Type:
  str

#### PytestExecutor.__processData

__processData(data)

Private slot to process the received data.

data (dict)
  data object received

#### PytestExecutor.createArguments

createArguments(config)

Public method to create the arguments needed to start the test process.

config (TestConfig)
  configuration for the test execution

Return:
  list of process arguments

Return Type:
  list of str

#### PytestExecutor.finished

finished()

Public method handling the unit test process been finished.

This method should read the results (if necessary) and emit the signal testFinished.

#### PytestExecutor.getVersions

getVersions(interpreter)

Public method to get the test framework version and version information of its installed plugins.

interpreter (str)
  interpreter to be used for the test

Return:
  dictionary containing the framework name and version and the list of available plugins with name and version each

Return Type:
  dict

#### PytestExecutor.hasCoverage

hasCoverage(interpreter)

Public method to get the test framework version and version information of its installed plugins.

interpreter (str)
  interpreter to be used for the test

Return:
  flag indicating the availability of coverage functionality

Return Type:
  bool

#### PytestExecutor.start

start(config, pythonpath)

Public method to start the testing process.

config (TestConfig)
  configuration for the test execution
pythonpath (list of str)
  list of directories to be added to the Python path

Up