Skip to content

Commit

Permalink
Remove references for nosetests
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeldelucena committed Aug 15, 2024
1 parent 19c39be commit 74c1eb7
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 261 deletions.
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ How does *funq* works

- **funq** is a python package that offers an API to interact with a
**libFunq** TCP server. It is the client side of the project, and uses
nosetests to launch FUNctional Qt tests.
pytest to launch FUNctional Qt tests.

Compatibility
=============

Funq currently works with Python >= 3.5, Qt4 and Qt5 on GNU/Linux, macOS and
Funq currently works with Python >= 3.5, Qt5 and Qt6 on GNU/Linux, macOS and
Windows.

Documentation
Expand All @@ -125,4 +125,6 @@ functional tests with **funq**.
Thanks also to Jean-Luc Rouzoul, Dominique Constant and Mickaël Guérin for
having supported this project.

Thanks to all the contributors for their patches, bug reports, and feedback.

Without them, **funq** would never have become a free software !
4 changes: 2 additions & 2 deletions client/doc/gkit_aliases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ You can use these aliases in the aliases file in a standard way (between {}).
manager is used - **default** is always used.

To use another graphical kit, you have to specify it with the *funq-gkit*
nose option. Example:
pytest option. Example:

.. code-block:: bash
nosetests --with-funq --funq-gkit kde
pytest --with-funq --funq-gkit kde
48 changes: 16 additions & 32 deletions client/doc/launching_tests.rst
Original file line number Diff line number Diff line change
@@ -1,90 +1,74 @@
Launching tests (nose)
======================

Tests are launched by `nose <https://nose.readthedocs.org/en/latest/>`_,
Tests are launched by `pytest <https://pytest.readthedocs.org/en/latest/>`_,
and you have to tell it to use the **funq** plugin.

Manual launching
----------------

Basically::

nosetests --with-funq
pytest --with-funq

The command must be started from the folder containing tests files and
the **funq.conf** configuration file.

.. note::

There are many options for nose, and some specifics to the **funq**
plugin. See ``nosetests --help`` for an exhaustive list.
There are many options for pytest, and some specifics to the **funq**
plugin. See ``pytest --help`` for an exhaustive list.

Example::

# launch tests with all stdout/stderr output and stop on the first error
nosetests --with-funq -s -x
pytest --with-funq -s -x

Defining default options
------------------------

Every nose option may be specified by default in a file named **setup.cfg**.
You can look at the nose documentation for more informations.
Every pytest option may be specified by default in a file named **setup.cfg**.
You can look at the pytest documentation for more informations.

Example:

.. code-block:: ini
[nosetests]
[pytest]
verbosity=2
with-funq=1
.. note::

This configuration is very useful, and allow to type only **nosetests**
on the command line instead of ``nosetests --with-funq -vv``. I highly
This configuration is very useful, and allow to type only **pytest**
on the command line instead of ``pytest --with-funq -vv``. I highly
recommend this configuration and I will use it in the following
documentation.

Selecting tests to launch
-------------------------

It s possible to select tests to launch using nose.
It s possible to select tests to launch using pytest.

Example::

# every tests in a given file
nosetests test_export.py
pytest test_export.py

# every tests of a given class in a test file
nosetests test_export.py:TestExportElectre
pytest test_export.py:TestExportElectre

# just one test (one method)
nosetests test_export.py:TestExportElectre.test_export_b6
pytest test_export.py:TestExportElectre.test_export_b6

.. note::

See the nose documeation fo more information.
See the pytest documeation fo more information.

If the verbosity option is equal to 2, the tests execution will show
test names with the same format. This means that you can then copy/paste
a test name to restart it.

Going further
-------------

**nose** got plenty of usefuls plugins !

Some are integrated in nose, others are third-party plugins and need a
proper installation.

Som of the interesting nose plugins are listed here:

- **xunit**: format tests output using xunit
- **attributeselector**: select tests given their attributes
- **collect-only**: allow to only list tests without really execute them

See the nose documentation, and google to find others usefuls plugins !

.. note::

It is also easy to write your own `nose plugins <http://nose.readthedocs.org/en/latest/plugins/writing.html>`_.
It is also easy to write your own `pytest plugins <https://docs.pytest.org/en/latest/how-to/writing_plugins.html#writing-your-own-plugin>`_.
2 changes: 1 addition & 1 deletion client/doc/qml_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Run the test

Just run::

nosetests --with-funq
pytest --with-funq

In the `qmltest` folder and watch it pass.

Expand Down
16 changes: 8 additions & 8 deletions client/doc/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ And that funq is installed with:

.. code-block:: bash
nosetests -h | grep 'with-funq'
pytest -h | grep 'with-funq'
.. important::

Expand Down Expand Up @@ -90,7 +90,7 @@ Well done ! Let's run this first test. Type the following command:

.. code-block:: bash
nosetests --with-funq
pytest --with-funq
One window must appear, and close after a few seconds. The output on the
terminal must look like this::
Expand All @@ -103,13 +103,13 @@ terminal must look like this::

.. note::

The option ``--with-funq`` given to nosetests allow to use the funq plugin
The option ``--with-funq`` given to pytest allow to use the funq plugin
that will read the configuration file and execute your tests.

.. note::

**nosetests** has multiples options to allow for example the generation
of an xml file to format tests result. See **nosetests -h**.
**pytest** has multiples options to allow for example the generation
of an xml file to format tests result. See **pytest -h**.

And voilà! You have written and launched your first funq test. Now let's
go a bit further by adding two tests and use an aliases file.
Expand Down Expand Up @@ -159,7 +159,7 @@ Now you can start tests again:

.. code-block:: bash
nosetests --with-funq
pytest --with-funq
.. note::

Expand All @@ -170,15 +170,15 @@ Now you can start tests again:

.. code-block:: bash
nosetests --with-funq test_widgets.py
pytest --with-funq test_widgets.py
.. important::

It is really important even for functional tests to not write tests
that depends on others tests. In other words, the
*order of test execution must not be important*. This allow to limit
side effects and to find quickly why a test failed. This being said,
**nosetests** does not assure any order in test execution.
**pytest** does not assure any order in test execution.

Going further
-------------
Expand Down
Loading

0 comments on commit 74c1eb7

Please sign in to comment.