Commit 0b689d6f authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[doc][contribute] Improve coding instructions

parent f8d27525
......@@ -74,6 +74,58 @@ If you would like to install them all using pip you can call: ::
$ pip install -r pre-commit-dependencies.txt
Writing code
beat.editor is a python application or rather Qt Python application. It will use
the `QtWidgets`_ module for the GUI part.
The current implementation will use `PyQt`_ as `Qt for Python`_ is not yet
available on conda.
While the code is written in Python the API is mostly the same as the C++
framework minus some pythonism that can be found in the `PyQt documentation`_.
Writing tests
beat.editor uses pytest as its testing framework because of the `pytest-qt`_
module that provides support for testing Qt based application.
An example of tests is shown here:
.. literalinclude:: ../beat/editor/test/
Tests can fall in to categories:
- Automatic tests
- Manual tests
Automatic tests are tests that can be fully automated using pytest and pytest-qt
while manual tests are tests than requires that a person takes a look at the
output of said test. For example check that the rendering of some GUI element is
the expected output. This kind of test may require writing a minimal application
that will be as automated as possible in order for the operator to only have to
do the manual check(s) required.
Run tests
beat.editor uses pytest to run its test suite. ::
$ pytest -sv
Will run all the tests verbosely and not capture the outputs of the test. The
`-s` option is mandatory if there's a need to brake in the code using python's
Coding guidelines
......@@ -190,3 +242,5 @@ Merge message
Merge messages should again be meaningful and concise about the what and the
.. include:: links.rst
......@@ -19,4 +19,10 @@
.. _bob:
.. _idiap:
.. _eigenface:
.. _BEAT documentation:
\ No newline at end of file
.. _BEAT documentation:
.. _Qt:
.. _QtWidgets:
.. _Qt for python:
.. _PyQt:
.. _PyQt documentation:
.. _pytest-qt:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment