src/eric7/Documentation/Source/eric7.Testing.Interfaces.PytestExecutor.html

Sat, 20 Apr 2024 18:02:35 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 20 Apr 2024 18:02:35 +0200
branch
eric7
changeset 10684
58c7f23ae1cb
parent 10479
856476537696
permissions
-rw-r--r--

Regenerated source code documentation.

<!DOCTYPE html>
<html><head>
<title>eric7.Testing.Interfaces.PytestExecutor</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<a NAME="top" ID="top"></a>
<h1>eric7.Testing.Interfaces.PytestExecutor</h1>
<p>
Module implementing the executor for the 'pytest' framework.
</p>

<h3>Global Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>

<h3>Classes</h3>
<table>
<tr>
<td><a href="#PytestExecutor">PytestExecutor</a></td>
<td>Class implementing the executor for the 'pytest' framework.</td>
</tr>
</table>

<h3>Functions</h3>
<table>
<tr><td>None</td></tr>
</table>

<hr />
<hr />
<a NAME="PytestExecutor" ID="PytestExecutor"></a>
<h2>PytestExecutor</h2>
<p>
    Class implementing the executor for the 'pytest' framework.
</p>

<h3>Derived from</h3>
TestExecutorBase
<h3>Class Attributes</h3>
<table>
<tr><td>module</td></tr>
<tr><td>name</td></tr>
<tr><td>runner</td></tr>
</table>

<h3>Class Methods</h3>
<table>
<tr><td>None</td></tr>
</table>

<h3>Methods</h3>
<table>
<tr>
<td><a href="#PytestExecutor.__init__">PytestExecutor</a></td>
<td>Constructor</td>
</tr>
<tr>
<td><a href="#PytestExecutor.__nodeid2testname">__nodeid2testname</a></td>
<td>Private method to convert a nodeid to a test name.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.__nodeid2testpath">__nodeid2testpath</a></td>
<td>Private method to convert a nodeid to a test path list.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.__normalizeModuleName">__normalizeModuleName</a></td>
<td>Private method to convert a module name reported by pytest to Python conventions.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.__processData">__processData</a></td>
<td>Private slot to process the received data.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.createArguments">createArguments</a></td>
<td>Public method to create the arguments needed to start the test process.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.discover">discover</a></td>
<td>Public method to start the test discovery process.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.finished">finished</a></td>
<td>Public method handling the unit test process been finished.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.getMarkers">getMarkers</a></td>
<td>Public method to get the list of defined markers.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.getVersions">getVersions</a></td>
<td>Public method to get the test framework version and version information of its installed plugins.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.hasCoverage">hasCoverage</a></td>
<td>Public method to check, if the collection of coverage data is available.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.start">start</a></td>
<td>Public method to start the testing process.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.startDebug">startDebug</a></td>
<td>Public method to start the test run with debugger support.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.supportsMarkers">supportsMarkers</a></td>
<td>Public method to indicate the support for test filtering using markers and/or marker expressions.</td>
</tr>
<tr>
<td><a href="#PytestExecutor.supportsPatterns">supportsPatterns</a></td>
<td>Public method to indicate the support for test filtering using test name patterns or a test name pattern expression.</td>
</tr>
</table>

<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>


<a NAME="PytestExecutor.__init__" ID="PytestExecutor.__init__"></a>
<h4>PytestExecutor (Constructor)</h4>
<b>PytestExecutor</b>(<i>testWidget</i>)
<p>
        Constructor
</p>

<dl>

<dt><i>testWidget</i> (TestingWidget)</dt>
<dd>
reference to the unit test widget
</dd>
</dl>
<a NAME="PytestExecutor.__nodeid2testname" ID="PytestExecutor.__nodeid2testname"></a>
<h4>PytestExecutor.__nodeid2testname</h4>
<b>__nodeid2testname</b>(<i>nodeid</i>)
<p>
        Private method to convert a nodeid to a test name.
</p>

<dl>

<dt><i>nodeid</i> (str)</dt>
<dd>
nodeid to be converted
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
test name
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="PytestExecutor.__nodeid2testpath" ID="PytestExecutor.__nodeid2testpath"></a>
<h4>PytestExecutor.__nodeid2testpath</h4>
<b>__nodeid2testpath</b>(<i>nodeid</i>)
<p>
        Private method to convert a nodeid to a test path list.
</p>

<dl>

<dt><i>nodeid</i> (str)</dt>
<dd>
nodeid to be converted
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
test path list
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="PytestExecutor.__normalizeModuleName" ID="PytestExecutor.__normalizeModuleName"></a>
<h4>PytestExecutor.__normalizeModuleName</h4>
<b>__normalizeModuleName</b>(<i>name</i>)
<p>
        Private method to convert a module name reported by pytest to Python
        conventions.
</p>
<p>
        This method strips the extensions '.pyw' and '.py' first and replaces
        '/' and '\' thereafter.
</p>

<dl>

<dt><i>name</i> (str)</dt>
<dd>
module name reported by pytest
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
module name iaw. Python conventions
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="PytestExecutor.__processData" ID="PytestExecutor.__processData"></a>
<h4>PytestExecutor.__processData</h4>
<b>__processData</b>(<i>data</i>)
<p>
        Private slot to process the received data.
</p>

<dl>

<dt><i>data</i> (dict)</dt>
<dd>
data object received
</dd>
</dl>
<a NAME="PytestExecutor.createArguments" ID="PytestExecutor.createArguments"></a>
<h4>PytestExecutor.createArguments</h4>
<b>createArguments</b>(<i>config</i>)
<p>
        Public method to create the arguments needed to start the test process.
</p>

<dl>

<dt><i>config</i> (TestConfig)</dt>
<dd>
configuration for the test execution
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
list of process arguments
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="PytestExecutor.discover" ID="PytestExecutor.discover"></a>
<h4>PytestExecutor.discover</h4>
<b>discover</b>(<i>config, pythonpath</i>)
<p>
        Public method to start the test discovery process.
</p>

<dl>

<dt><i>config</i> (TestConfig)</dt>
<dd>
configuration for the test discovery
</dd>
<dt><i>pythonpath</i> (list of str)</dt>
<dd>
list of directories to be added to the Python path
</dd>
</dl>
<a NAME="PytestExecutor.finished" ID="PytestExecutor.finished"></a>
<h4>PytestExecutor.finished</h4>
<b>finished</b>(<i></i>)
<p>
        Public method handling the unit test process been finished.
</p>
<p>
        This method should read the results (if necessary) and emit the signal
        testFinished.
</p>

<a NAME="PytestExecutor.getMarkers" ID="PytestExecutor.getMarkers"></a>
<h4>PytestExecutor.getMarkers</h4>
<b>getMarkers</b>(<i>interpreter, workdir</i>)
<p>
        Public method to get the list of defined markers.
</p>

<dl>

<dt><i>interpreter</i> (str)</dt>
<dd>
interpreter to be used for the test
</dd>
<dt><i>workdir</i> (str)</dt>
<dd>
name of the working directory
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
dictionary containing the marker as key and the associated description
            as value
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
dict
</dd>
</dl>
<a NAME="PytestExecutor.getVersions" ID="PytestExecutor.getVersions"></a>
<h4>PytestExecutor.getVersions</h4>
<b>getVersions</b>(<i>interpreter</i>)
<p>
        Public method to get the test framework version and version information
        of its installed plugins.
</p>

<dl>

<dt><i>interpreter</i> (str)</dt>
<dd>
interpreter to be used for the test
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
dictionary containing the framework name and version and the
            list of available plugins with name and version each
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
dict
</dd>
</dl>
<a NAME="PytestExecutor.hasCoverage" ID="PytestExecutor.hasCoverage"></a>
<h4>PytestExecutor.hasCoverage</h4>
<b>hasCoverage</b>(<i>interpreter</i>)
<p>
        Public method to check, if the collection of coverage data is available.
</p>

<dl>

<dt><i>interpreter</i> (str)</dt>
<dd>
interpreter to be used for the test
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
flag indicating the availability of coverage functionality
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl>
<a NAME="PytestExecutor.start" ID="PytestExecutor.start"></a>
<h4>PytestExecutor.start</h4>
<b>start</b>(<i>config, pythonpath</i>)
<p>
        Public method to start the testing process.
</p>

<dl>

<dt><i>config</i> (TestConfig)</dt>
<dd>
configuration for the test execution
</dd>
<dt><i>pythonpath</i> (list of str)</dt>
<dd>
list of directories to be added to the Python path
</dd>
</dl>
<a NAME="PytestExecutor.startDebug" ID="PytestExecutor.startDebug"></a>
<h4>PytestExecutor.startDebug</h4>
<b>startDebug</b>(<i>config, pythonpath, debugger</i>)
<p>
        Public method to start the test run with debugger support.
</p>

<dl>

<dt><i>config</i> (TestConfig)</dt>
<dd>
configuration for the test execution
</dd>
<dt><i>pythonpath</i> (list of str)</dt>
<dd>
list of directories to be added to the Python path
</dd>
<dt><i>debugger</i> (DebugUI)</dt>
<dd>
refference to the debugger interface
</dd>
</dl>
<a NAME="PytestExecutor.supportsMarkers" ID="PytestExecutor.supportsMarkers"></a>
<h4>PytestExecutor.supportsMarkers</h4>
<b>supportsMarkers</b>(<i>_interpreter</i>)
<p>
        Public method to indicate the support for test filtering using markers and/or
        marker expressions.
</p>

<dl>

<dt><i>_interpreter</i> (str)</dt>
<dd>
interpreter to be used for the test (unused)
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
flag indicating support of markers
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl>
<a NAME="PytestExecutor.supportsPatterns" ID="PytestExecutor.supportsPatterns"></a>
<h4>PytestExecutor.supportsPatterns</h4>
<b>supportsPatterns</b>(<i>_interpreter</i>)
<p>
        Public method to indicate the support for test filtering using test name
        patterns or a test name pattern expression.
</p>

<dl>

<dt><i>_interpreter</i> (str)</dt>
<dd>
interpreter to be used for the test (unused)
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
flag indicating support of markers
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial