A majority of the unit tests depend on a database connections. This was a conscious decision, as we said that the DB is an integral part of simtools.
I think we learnt in the meanwhile that we can replace the DB connections in most cases using the unittest/pytest mocking mechanism. We should apply this wherever possible.
Given the large number of unittests, implementing this for all existing tests is a huge task.
Suggest to:
use mocking when implementing new tests
change existing tests whenever we touch the test code
An ideal solution would be to have no / very few DB connections in unit tests. Those which require a connection should get a pytest label.
A majority of the unit tests depend on a database connections. This was a conscious decision, as we said that the DB is an integral part of simtools.
I think we learnt in the meanwhile that we can replace the DB connections in most cases using the unittest/pytest mocking mechanism. We should apply this wherever possible.
Given the large number of unittests, implementing this for all existing tests is a huge task.
Suggest to:
An ideal solution would be to have no / very few DB connections in unit tests. Those which require a connection should get a pytest label.