Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/pendulum/tz/exceptions.py: 72%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

18 statements  

1from __future__ import annotations 

2 

3from typing import TYPE_CHECKING 

4 

5 

6if TYPE_CHECKING: 

7 from datetime import datetime 

8 

9 

10class TimezoneError(ValueError): 

11 pass 

12 

13 

14class InvalidTimezone(TimezoneError): 

15 pass 

16 

17 

18class NonExistingTime(TimezoneError): 

19 message = "The datetime {} does not exist." 

20 

21 def __init__(self, dt: datetime) -> None: 

22 message = self.message.format(dt) 

23 

24 super().__init__(message) 

25 

26 

27class AmbiguousTime(TimezoneError): 

28 message = "The datetime {} is ambiguous." 

29 

30 def __init__(self, dt: datetime) -> None: 

31 message = self.message.format(dt) 

32 

33 super().__init__(message)