Renamed Install to Getting started; moved notes to index

This commit is contained in:
Daniele Procida 2021-03-10 18:27:30 +00:00
parent bfbf733a3e
commit 4a19533ba5
3 changed files with 19 additions and 18 deletions

View File

@ -2,7 +2,7 @@
<ul> <ul>
<li><a href="{{ pathto('index') }}">Home</a></li> <li><a href="{{ pathto('index') }}">Home</a></li>
<li><a href="{{ pathto('getting-started') }}">Install</a></li> <li><a href="{{ pathto('getting-started') }}">Get started</a></li>
<li><a href="{{ pathto('contents') }}">Contents</a></li> <li><a href="{{ pathto('contents') }}">Contents</a></li>
<li><a href="{{ pathto('reference') }}">API Reference</a></li> <li><a href="{{ pathto('reference') }}">API Reference</a></li>
<li><a href="{{ pathto('example/index') }}">Examples</a></li> <li><a href="{{ pathto('example/index') }}">Examples</a></li>

View File

@ -1,22 +1,14 @@
Installation and Getting Started Get Started
=================================== ===================================
**Pythons**: Python 3.6, 3.7, 3.8, 3.9, PyPy3
**Platforms**: Linux and Windows
**PyPI package name**: `pytest <https://pypi.org/project/pytest/>`_
**Documentation as PDF**: `download latest <https://media.readthedocs.org/pdf/pytest/latest/pytest.pdf>`_
``pytest`` is a framework that makes building simple and scalable tests easy. Tests are expressive and readable—no boilerplate code required. Get started in minutes with a small unit test or complex functional test for your application or library.
.. _`getstarted`: .. _`getstarted`:
.. _`installation`: .. _`installation`:
Install ``pytest`` Install ``pytest``
---------------------------------------- ----------------------------------------
``pytest`` requires: Python 3.6, 3.7, 3.8, 3.9, or PyPy3.
1. Run the following command in your command line: 1. Run the following command in your command line:
.. code-block:: bash .. code-block:: bash
@ -35,7 +27,7 @@ Install ``pytest``
Create your first test Create your first test
---------------------------------------------------------- ----------------------------------------------------------
Create a simple test function with just four lines of code: Create a new file called ``test_sample.py``, containing a function, and a test:
.. code-block:: python .. code-block:: python
@ -47,7 +39,7 @@ Create a simple test function with just four lines of code:
def test_answer(): def test_answer():
assert func(3) == 5 assert func(3) == 5
Thats it. You can now execute the test function: The test
.. code-block:: pytest .. code-block:: pytest

View File

@ -13,10 +13,19 @@ pytest: helps you write better programs
.. module:: pytest .. module:: pytest
The ``pytest`` framework makes it easy to write small tests, yet The ``pytest`` framework makes it easy to write small, readable tests, and can
scales to support complex functional testing for applications and libraries. scale to support complex functional testing for applications and libraries.
An example of a simple test:
**Pythons**: ``pytest`` requires: Python 3.6, 3.7, 3.8, 3.9, or PyPy3.
**PyPI package name**: `pytest <https://pypi.org/project/pytest/>`_
**Documentation as PDF**: `download latest <https://media.readthedocs.org/pdf/pytest/latest/pytest.pdf>`_
A quick example
---------------
.. code-block:: python .. code-block:: python
@ -56,7 +65,7 @@ To execute it:
============================ 1 failed in 0.12s ============================= ============================ 1 failed in 0.12s =============================
Due to ``pytest``'s detailed assertion introspection, only plain ``assert`` statements are used. Due to ``pytest``'s detailed assertion introspection, only plain ``assert`` statements are used.
See :ref:`Getting Started <getstarted>` for more examples. See :ref:`Get started <getstarted>` for a basic introduction to using pytest.
Features Features