Closed BasilBibi closed 5 years ago
Instead of using setUp() and tearDown() which run before and after each and every test case, use setUpClass() and tearDownClass() as these only run once per test class.
setUp()
tearDown()
setUpClass()
tearDownClass()
You can then access dao using type(self).dao
type(self).dao
https://stackoverflow.com/questions/25577578/python-access-class-variable-from-instance/25577642#25577642
I changed OrderPostgresDaoTests and they ran in 7 passed in 2.67 seconds
OrderPostgresDaoTests
7 passed in 2.67 seconds
Instead of using
setUp()
andtearDown()
which run before and after each and every test case, usesetUpClass()
andtearDownClass()
as these only run once per test class.You can then access dao using
type(self).dao
https://stackoverflow.com/questions/25577578/python-access-class-variable-from-instance/25577642#25577642