diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_eventprocessor/event_processor.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_eventprocessor/event_processor.py index 1d322ff03751..634ed955d3a5 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_eventprocessor/event_processor.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_eventprocessor/event_processor.py @@ -74,9 +74,8 @@ def __init__( self._partition_close_handler = kwargs.get( "on_partition_close", None ) # type: Optional[Callable[[PartitionContext, CloseReason], None]] - self._checkpoint_store = kwargs.get( - "checkpoint_store" - ) or InMemoryCheckpointStore() # type: Optional[CheckpointStore] + checkpoint_store = kwargs.get("checkpoint_store") # type: Optional[CheckpointStore] + self._checkpoint_store = checkpoint_store or InMemoryCheckpointStore() self._initial_event_position = kwargs.get( "initial_event_position", "@latest" ) # type: Union[str, int, datetime, Dict[str, Any]] @@ -93,7 +92,7 @@ def __init__( # Receive parameters self._owner_level = kwargs.get("owner_level", None) # type: Optional[int] - if "checkpoint_store" in kwargs and self._owner_level is None: + if checkpoint_store and self._owner_level is None: self._owner_level = 0 self._prefetch = kwargs.get("prefetch", None) # type: Optional[int] self._track_last_enqueued_event_properties = kwargs.get( diff --git a/sdk/eventhub/azure-eventhub/tests/livetest/synctests/test_auth.py b/sdk/eventhub/azure-eventhub/tests/livetest/synctests/test_auth.py index 4df5040c8b29..aba361ed645f 100644 --- a/sdk/eventhub/azure-eventhub/tests/livetest/synctests/test_auth.py +++ b/sdk/eventhub/azure-eventhub/tests/livetest/synctests/test_auth.py @@ -14,7 +14,7 @@ def test_client_secret_credential(aad_credential, live_eventhub): try: from azure.identity import EnvironmentCredential - except ImportError as e: + except: pytest.skip("No azure identity library") credential = EnvironmentCredential() producer_client = EventHubProducerClient(fully_qualified_namespace=live_eventhub['hostname'],