[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[0cf85fa] | 2 | <!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[114f6db9] | 7 | <!ENTITY pytest-download-http "https://files.pythonhosted.org/packages/source/p/pytest/pytest-&pytest-version;.tar.gz">
|
---|
[036821b] | 8 | <!ENTITY pytest-download-ftp " ">
|
---|
[569925c7] | 9 | <!ENTITY pytest-md5sum "&pytest-md5sum;">
|
---|
[81c8f59] | 10 | <!ENTITY pytest-size "1.4 MB">
|
---|
[6f58853] | 11 | <!ENTITY pytest-buildsize "38 MB (with tests)">
|
---|
| 12 | <!ENTITY pytest-time "0.8 SBU (with tests)">
|
---|
[0cf85fa] | 13 | ]>
|
---|
| 14 |
|
---|
[036821b] | 15 | <sect2 id="pytest" xreflabel="pytest-&pytest-version;">
|
---|
[0cf85fa] | 16 |
|
---|
[25ee667] | 17 | <title>Pytest-&pytest-version;</title>
|
---|
[0cf85fa] | 18 |
|
---|
| 19 | <indexterm zone="pytest">
|
---|
| 20 | <primary sortas="a-pytest">pytest</primary>
|
---|
| 21 | </indexterm>
|
---|
| 22 |
|
---|
| 23 | <sect3 role="package">
|
---|
[25ee667] | 24 | <title>Introduction to Pytest Module</title>
|
---|
[0cf85fa] | 25 |
|
---|
| 26 | <para>
|
---|
[25ee667] | 27 | The <application>Pytest</application> framework makes it easy to
|
---|
| 28 | write small, readable tests, and can scale to support complex
|
---|
| 29 | functional testing for applications and libraries.
|
---|
[0cf85fa] | 30 | </para>
|
---|
| 31 |
|
---|
[09ddf35a] | 32 | &lfs122_checked;
|
---|
[0cf85fa] | 33 |
|
---|
| 34 | <bridgehead renderas="sect4">Package Information</bridgehead>
|
---|
| 35 | <itemizedlist spacing="compact">
|
---|
| 36 | <listitem>
|
---|
| 37 | <para>
|
---|
[036821b] | 38 | Download (HTTP): <ulink url="&pytest-download-http;"/>
|
---|
[0cf85fa] | 39 | </para>
|
---|
| 40 | </listitem>
|
---|
| 41 | <listitem>
|
---|
| 42 | <para>
|
---|
[036821b] | 43 | Download (FTP): <ulink url="&pytest-download-ftp;"/>
|
---|
[0cf85fa] | 44 | </para>
|
---|
| 45 | </listitem>
|
---|
| 46 | <listitem>
|
---|
| 47 | <para>
|
---|
[036821b] | 48 | Download MD5 sum: &pytest-md5sum;
|
---|
[0cf85fa] | 49 | </para>
|
---|
| 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
| 52 | <para>
|
---|
[036821b] | 53 | Download size: &pytest-size;
|
---|
[0cf85fa] | 54 | </para>
|
---|
| 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
| 57 | <para>
|
---|
[036821b] | 58 | Estimated disk space required: &pytest-buildsize;
|
---|
[0cf85fa] | 59 | </para>
|
---|
| 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
| 62 | <para>
|
---|
[036821b] | 63 | Estimated build time: &pytest-time;
|
---|
[0cf85fa] | 64 | </para>
|
---|
| 65 | </listitem>
|
---|
| 66 | </itemizedlist>
|
---|
| 67 |
|
---|
[25ee667] | 68 | <bridgehead renderas="sect4">Pytest Dependencies</bridgehead>
|
---|
| 69 |
|
---|
| 70 | <bridgehead renderas="sect5">Required</bridgehead>
|
---|
| 71 | <para role="required">
|
---|
| 72 | <xref linkend="iniconfig"/>,
|
---|
[9b39ca60] | 73 | <xref linkend="packaging"/>, and
|
---|
| 74 | <xref linkend="pluggy"/>
|
---|
[25ee667] | 75 | </para>
|
---|
| 76 |
|
---|
| 77 | <bridgehead renderas="sect5">Recommended</bridgehead>
|
---|
| 78 | <para role="recommended">
|
---|
| 79 | <xref linkend="setuptools_scm"/>
|
---|
| 80 | </para>
|
---|
[0cf85fa] | 81 |
|
---|
[114f6db9] | 82 | <bridgehead renderas="sect5">Optional (for testing)</bridgehead>
|
---|
[0cf85fa] | 83 | <para role="optional">
|
---|
[72b95598] | 84 | <xref linkend="attrs"/>,
|
---|
[114f6db9] | 85 | <xref linkend="pygments"/>,
|
---|
| 86 | <xref linkend="requests"/>,
|
---|
| 87 | <ulink url="https://pypi.org/project/argcomplete/">argcomplete</ulink>,
|
---|
| 88 | <ulink url="https://pypi.org/project/hypothesis/">hypothesis</ulink>,
|
---|
[6b3ecbb4] | 89 | <ulink url="https://pypi.org/project/mock/">mock</ulink>, and
|
---|
[114f6db9] | 90 | <ulink url="https://pypi.org/project/xmlschema/">xmlschema</ulink>
|
---|
[0cf85fa] | 91 | </para>
|
---|
| 92 |
|
---|
| 93 | </sect3>
|
---|
| 94 |
|
---|
| 95 | <sect3 role="installation">
|
---|
[25ee667] | 96 | <title>Installation of Pytest</title>
|
---|
[0cf85fa] | 97 |
|
---|
[25ee667] | 98 | <para> Build the module: </para>
|
---|
[0cf85fa] | 99 |
|
---|
[db244ae2] | 100 | &build-wheel;
|
---|
[0cf85fa] | 101 |
|
---|
[25ee667] | 102 | <para>
|
---|
[74434cc] | 103 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
[25ee667] | 104 | </para>
|
---|
[0cf85fa] | 105 |
|
---|
[db244ae2] | 106 | <screen role="root"><userinput>&install-wheel; pytest</userinput></screen>
|
---|
[74434cc] | 107 |
|
---|
[25ee667] | 108 | <para>
|
---|
[74434cc] | 109 | The installation can be tested with the following commands:
|
---|
[25ee667] | 110 | </para>
|
---|
[0cf85fa] | 111 |
|
---|
[74434cc] | 112 | <screen remap="test"><userinput>python3 -m venv --system-site-packages testenv &&
|
---|
| 113 | source testenv/bin/activate &&
|
---|
[81c8f59] | 114 | pip3 install pytest[dev] xmlschema hypothesis &&
|
---|
[74434cc] | 115 | python3 /usr/bin/pytest<!-- no && because of a possible error -->
|
---|
| 116 | deactivate</userinput></screen>
|
---|
[0cf85fa] | 117 |
|
---|
| 118 | </sect3>
|
---|
| 119 |
|
---|
| 120 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 121 | href="../../../xincludes/pip3-cmd-explain.xml"/>
|
---|
| 122 |
|
---|
| 123 | <sect3 role="content">
|
---|
| 124 | <title>Contents</title>
|
---|
| 125 |
|
---|
| 126 | <segmentedlist>
|
---|
| 127 | <segtitle>Installed Programs</segtitle>
|
---|
| 128 | <segtitle>Installed Libraries</segtitle>
|
---|
| 129 | <segtitle>Installed Directories</segtitle>
|
---|
| 130 |
|
---|
| 131 | <seglistitem>
|
---|
| 132 | <seg>
|
---|
[114f6db9] | 133 | pytest and py.test (different files but with same content)
|
---|
[0cf85fa] | 134 | </seg>
|
---|
| 135 | <seg>None</seg>
|
---|
| 136 | <seg>
|
---|
[114f6db9] | 137 | /usr/lib/python&python3-majorver;/site-packages/_pytest,
|
---|
| 138 | /usr/lib/python&python3-majorver;/site-packages/pytest, and
|
---|
[036821b] | 139 | /usr/lib/python&python3-majorver;/site-packages/pytest-&pytest-version;.dist-info
|
---|
[0cf85fa] | 140 | </seg>
|
---|
| 141 | </seglistitem>
|
---|
| 142 | </segmentedlist>
|
---|
[114f6db9] | 143 |
|
---|
[0cf85fa] | 144 | <variablelist>
|
---|
| 145 | <bridgehead renderas="sect5">Short Descriptions</bridgehead>
|
---|
| 146 | <?dbfo list-presentation="list"?>
|
---|
| 147 | <?dbhtml list-presentation="table"?>
|
---|
| 148 |
|
---|
[036821b] | 149 | <varlistentry id="pytest-prog">
|
---|
| 150 | <term><command>pytest</command></term>
|
---|
[0cf85fa] | 151 | <listitem>
|
---|
| 152 | <para>
|
---|
[e343b67] | 153 | sets up, manages, and/or runs tests in python module source
|
---|
[114f6db9] | 154 | directories
|
---|
[0cf85fa] | 155 | </para>
|
---|
[036821b] | 156 | <indexterm zone="pytest pytest-prog">
|
---|
| 157 | <primary sortas="b-pytest-prog">pytest</primary>
|
---|
[0cf85fa] | 158 | </indexterm>
|
---|
| 159 | </listitem>
|
---|
| 160 | </varlistentry>
|
---|
| 161 |
|
---|
| 162 | </variablelist>
|
---|
[114f6db9] | 163 |
|
---|
[0cf85fa] | 164 | </sect3>
|
---|
| 165 |
|
---|
| 166 | </sect2>
|
---|