diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py index 7ba736fec9034..7496b5de5de65 100644 --- a/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py @@ -45,7 +45,7 @@ def _prepare_create_resource(self, test_class_instance, **kwargs): # generated, so in_recording will be True even if live_test is false, so a random name would be given. # In cached mode we need to avoid this because then for tests with recordings, they would not have a moniker. if (self.live_test or test_class_instance.in_recording) \ - and not (not self.live_test and test_class_instance.in_recording and self._use_cache): + and not (not test_class_instance.is_live and test_class_instance.in_recording and self._use_cache): resource_name = self.random_name if not self.live_test and isinstance(self, RecordingProcessor): test_class_instance.recording_processors.append(self)