Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1133)

Unified Diff: appengine/findit/common/time_util.py

Issue 2391063002: [Findit] Fix flaky tests due to importing pytz. (Closed)
Patch Set: Fix nit. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/findit/common/time_util.py
diff --git a/appengine/findit/common/time_util.py b/appengine/findit/common/time_util.py
index 407ed700f72e2dc11212c30d2be6190a907157bb..daebcc115d2f9ca6bccd6607982afc20bf6739a6 100644
--- a/appengine/findit/common/time_util.py
+++ b/appengine/findit/common/time_util.py
@@ -45,16 +45,15 @@ def FormatDatetime(date):
return date.strftime('%Y-%m-%d %H:%M:%S UTC')
-def GetDatetimeInTimezone(timezone_name, date_time=None):
+def GetDatetimeInTimezone(timezone_name, date_time):
"""Returns the datetime.datetime of the given one in the specified timezone.
Args:
timezone_name (str): The name of any timezone supported by pytz.
date_time (datetime.datetime): The optional datetime to be converted into
- the new timezone. If not given, default to UTC now.
+ the new timezone.
Returns:
A datetime.datetime of the given one in the specified timezone.
"""
- date_time = date_time or GetUTCNowWithTimezone()
return date_time.astimezone(pytz.timezone(timezone_name))
« no previous file with comments | « appengine/findit/common/test/time_util_test.py ('k') | appengine/findit/waterfall/flake/recursive_flake_pipeline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698