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

Update README

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:
https://gitlab.physmed.chudequebec.ca/gacou54/howtotest/blob/master/docs/pdf/HowToTest.pdf
__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.
## Setup.py
The `setup.py` 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:
```bash
$ python setup.py test
```
You can run linters (checking code format and typing) with
```bash
$ python setup.py lint
```
Unit tests with
```bash
$ python setup.py unit
```
And integration tests with
```bash
$ python setup.py integration
```
There is others commands, you can look the `setup.py` to see them.
A simplier `setup.py` file can look like the `basic_setup.py` 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