Commit 91583f88 authored by Gabriel Couture's avatar Gabriel Couture


parent f8ae17dd
Pipeline #194 passed with stage
in 9 seconds
# HowToTestBasic
Example of a python project with tests.
Example of a python project with tests. Presentation in french can be found here:
__Note__: Please note that this project does not really respect
"good practices" of software engineering. Functions in the `conversion`
"good practices" of software engineering. Some functions in the `conversion`
module should have been in the `DVH` class. The reason why it is not the case
in this example is because I want to show simple tests of functions (see `tests/test_conversion`) that
use a custom object (`DVH`). This way, we can introduce `mocking`, which is
use a custom object (`DVH` here). This way, we can introduce `mocking`, which is
an important concept of unit testing.
The `` file is where you setup your commands for the tests.
Here, in this basic project example, the only command to run tests is:
Here, in this project example, the command to run all tests is:
$ python test
You can run linters (checking code format and typing) with
$ python lint
Unit tests with
$ python unit
And integration tests with
$ python integration
There is others commands, you can look the `` to see them.
A simplier `` file can look like the `` file.
## Virtual environment
Markdown is supported
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