[tests] Avoid passing around member variables in test_framework