[0cf85fa] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 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;">
|
---|
[9fabaa4b] | 10 | <!ENTITY pytest-size "1.3 MB">
|
---|
[5bda216] | 11 | <!ENTITY pytest-buildsize "8.2 MB (add 44 MB for tests)">
|
---|
[9fabaa4b] | 12 | <!ENTITY pytest-time "less than 0.1 SBU (1.0 SBU for 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 |
|
---|
[ed345e7] | 32 | &lfs120_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"/>,
|
---|
| 73 | <xref linkend="packaging"/>,
|
---|
[8f65da99] | 74 | <xref linkend="pluggy"/>, and
|
---|
[bc73ecf] | 75 | <xref linkend="py"/>
|
---|
[25ee667] | 76 | </para>
|
---|
| 77 |
|
---|
| 78 | <bridgehead renderas="sect5">Recommended</bridgehead>
|
---|
| 79 | <para role="recommended">
|
---|
| 80 | <xref linkend="setuptools_scm"/>
|
---|
| 81 | </para>
|
---|
[0cf85fa] | 82 |
|
---|
[114f6db9] | 83 | <bridgehead renderas="sect5">Optional (for testing)</bridgehead>
|
---|
[0cf85fa] | 84 | <para role="optional">
|
---|
[114f6db9] | 85 | <xref linkend="pygments"/>,
|
---|
| 86 | <xref linkend="requests"/>,
|
---|
| 87 | <ulink url="https://pypi.org/project/argcomplete/">argcomplete</ulink>,
|
---|
[8f7f93b] | 88 | <ulink url="https://pypi.org/project/elementpath/">elementpath</ulink>,
|
---|
[114f6db9] | 89 | <ulink url="https://pypi.org/project/hypothesis/">hypothesis</ulink>,
|
---|
[8f65da99] | 90 | <ulink url="https://pypi.org/project/mock/">mock</ulink>,
|
---|
[8f7f93b] | 91 | <ulink url="https://pypi.org/project/nose/">nose</ulink>,
|
---|
| 92 | <ulink url="https://pypi.org/project/sortedcontainers/">sortedcontainers</ulink>, and
|
---|
[114f6db9] | 93 | <ulink url="https://pypi.org/project/xmlschema/">xmlschema</ulink>
|
---|
[0cf85fa] | 94 | </para>
|
---|
| 95 |
|
---|
| 96 | </sect3>
|
---|
| 97 |
|
---|
| 98 | <sect3 role="installation">
|
---|
[25ee667] | 99 | <title>Installation of Pytest</title>
|
---|
[0cf85fa] | 100 |
|
---|
[25ee667] | 101 | <para> Build the module: </para>
|
---|
[0cf85fa] | 102 |
|
---|
| 103 | <screen><userinput>pip3 wheel -w dist --no-build-isolation --no-deps $PWD</userinput></screen>
|
---|
| 104 |
|
---|
[25ee667] | 105 | <para>
|
---|
[74434cc] | 106 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
[25ee667] | 107 | </para>
|
---|
[0cf85fa] | 108 |
|
---|
[74434cc] | 109 | <screen role="root"><userinput>pip3 install --no-index --find-links dist --no-cache-dir --no-user pytest</userinput></screen>
|
---|
| 110 |
|
---|
[25ee667] | 111 | <para>
|
---|
[74434cc] | 112 | The installation can be tested with the following commands:
|
---|
[25ee667] | 113 | </para>
|
---|
[0cf85fa] | 114 |
|
---|
[74434cc] | 115 | <screen remap="test"><userinput>python3 -m venv --system-site-packages testenv &&
|
---|
| 116 | source testenv/bin/activate &&
|
---|
| 117 | pip3 install pytest[testing] &&
|
---|
| 118 | python3 /usr/bin/pytest<!-- no && because of a possible error -->
|
---|
| 119 | deactivate</userinput></screen>
|
---|
[0cf85fa] | 120 |
|
---|
[7fb07ec8] | 121 | <!-- With 7.4.0 and the toolchain from LFS 12.0, there are now 11 XFAILS
|
---|
[5bda216] | 122 | <para>
|
---|
[a5218250] | 123 | A few tests (11 of 3429) are known to fail.
|
---|
[5bda216] | 124 | </para>
|
---|
[7fb07ec8] | 125 | -->
|
---|
[0cf85fa] | 126 | </sect3>
|
---|
| 127 |
|
---|
| 128 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 129 | href="../../../xincludes/pip3-cmd-explain.xml"/>
|
---|
| 130 |
|
---|
| 131 | <sect3 role="content">
|
---|
| 132 | <title>Contents</title>
|
---|
| 133 |
|
---|
| 134 | <segmentedlist>
|
---|
| 135 | <segtitle>Installed Programs</segtitle>
|
---|
| 136 | <segtitle>Installed Libraries</segtitle>
|
---|
| 137 | <segtitle>Installed Directories</segtitle>
|
---|
| 138 |
|
---|
| 139 | <seglistitem>
|
---|
| 140 | <seg>
|
---|
[114f6db9] | 141 | pytest and py.test (different files but with same content)
|
---|
[0cf85fa] | 142 | </seg>
|
---|
| 143 | <seg>None</seg>
|
---|
| 144 | <seg>
|
---|
[114f6db9] | 145 | /usr/lib/python&python3-majorver;/site-packages/_pytest,
|
---|
| 146 | /usr/lib/python&python3-majorver;/site-packages/pytest, and
|
---|
[036821b] | 147 | /usr/lib/python&python3-majorver;/site-packages/pytest-&pytest-version;.dist-info
|
---|
[0cf85fa] | 148 | </seg>
|
---|
| 149 | </seglistitem>
|
---|
| 150 | </segmentedlist>
|
---|
[114f6db9] | 151 |
|
---|
[0cf85fa] | 152 | <variablelist>
|
---|
| 153 | <bridgehead renderas="sect5">Short Descriptions</bridgehead>
|
---|
| 154 | <?dbfo list-presentation="list"?>
|
---|
| 155 | <?dbhtml list-presentation="table"?>
|
---|
| 156 |
|
---|
[036821b] | 157 | <varlistentry id="pytest-prog">
|
---|
| 158 | <term><command>pytest</command></term>
|
---|
[0cf85fa] | 159 | <listitem>
|
---|
| 160 | <para>
|
---|
[114f6db9] | 161 | sets up, manages, and/or runs test in python module source
|
---|
| 162 | directories
|
---|
[0cf85fa] | 163 | </para>
|
---|
[036821b] | 164 | <indexterm zone="pytest pytest-prog">
|
---|
| 165 | <primary sortas="b-pytest-prog">pytest</primary>
|
---|
[0cf85fa] | 166 | </indexterm>
|
---|
| 167 | </listitem>
|
---|
| 168 | </varlistentry>
|
---|
| 169 |
|
---|
| 170 | </variablelist>
|
---|
[114f6db9] | 171 |
|
---|
[0cf85fa] | 172 | </sect3>
|
---|
| 173 |
|
---|
| 174 | </sect2>
|
---|