Functional tests: have all duplicated code in only one place
In the functional tests files (*.py
), a lot of lines of code is duplicated. Refactor it so it is included or imported.
Typical use case: changing the IP address of the host on which running the tests is painful.
Python resources:
- How to import other Python files
- Importing files from different folder
- Un gros guide bien gras sur les tests unitaires en Python, partie 2
- Leverage
setUpClass
,tearDownClass
,setUpModule
andtearDownModule
see Class and Module fixture ; which order is clearly explained in Fixture syntax and Flow reference
Edited by Matthieu FAURE