def test_process_config(request_app=test_request_config): process_config = {test_key: 'bar', 'process_var': 'foo'} CONFIG.push_process_config(process_config) assert CONFIG[test_key] == 'bar' assert CONFIG['process_var'] == 'foo' request_app() assert CONFIG[test_key] == 'bar' assert CONFIG['process_var'] == 'foo' CONFIG.pop_process_config() assert_raises(AttributeError, lambda: 'process_var' not in CONFIG) assert_raises(IndexError, CONFIG.pop_process_config)
def reset_config(): while True: try: CONFIG._pop_object() except IndexError: break