I currently have several Python unit tests that work fine when run separately. Unfortunately, when used together, their memory consumption increases, which leads to a memory problem or ultra-fast runtime at best.
My code to run the tests is as follows:
loader = unittest.TestLoader()
suite = unittest.TestSuite()
suite.addTests(loader.loadTestsFromModule(TestRemoveValues()))
runner = unittest.TextTestRunner(verbosity=2)
runner.run(suite)
I am going to create separate clips for separate tests in order to free memory between tests, but this does not seem elegant, and I'm not sure if it will work.
Any ideas on clearing the memory after each test?
source
share