]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
specify locale
authorAlex Morega <alex@grep.ro>
Mon, 6 Jan 2014 20:48:15 +0000 (22:48 +0200)
committerAlex Morega <alex@grep.ro>
Mon, 6 Jan 2014 21:12:26 +0000 (23:12 +0200)
otherwise, running tests in another locale fails
fixes #45, thanks @Arfrever!

babel/dates.py

index 72674e8aa454c3311b5779cde98b566a765d1959..73d54fa573c339f9d9326fbefa085f1d8b9c42f0 100644 (file)
@@ -733,9 +733,9 @@ def format_timedelta(delta, granularity='second', threshold=.85,
     In addition directional information can be provided that informs
     the user if the date is in the past or in the future:
 
-    >>> format_timedelta(timedelta(hours=1), add_direction=True)
+    >>> format_timedelta(timedelta(hours=1), add_direction=True, locale='en')
     u'In 1 hour'
-    >>> format_timedelta(timedelta(hours=-1), add_direction=True)
+    >>> format_timedelta(timedelta(hours=-1), add_direction=True, locale='en')
     u'1 hour ago'
 
     :param delta: a ``timedelta`` object representing the time difference to