Skip to content

TypeError: can’t compare offset-naive and offset-aware datetimes #98

@gli-jun-seo

Description

@gli-jun-seo

I was getting below errors during pytest

    def before_call(self, func: Callable[..., T], *args: Any, **kwargs: Any) -> T:
        """After the timeout elapses, move the circuit breaker to the "half-open"
        state; otherwise, raises ``CircuitBreakerError`` without any attempt
        to execute the real operation.
        """
        timeout = timedelta(seconds=self._breaker.reset_timeout)
        opened_at = self._breaker._state_storage.opened_at
>       if opened_at and datetime.now(UTC) < opened_at + timeout:
E       TypeError: can't compare offset-naive and offset-aware datetimes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions