Fix test_context_manager_valid