launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #27487
[Merge] ~cjwatson/launchpad:timedelta-repr into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:timedelta-repr into launchpad:master.
Commit message:
Cope with datetime.timedelta.__repr__ changes
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/408082
`datetime.timedelta.__repr__` changed its output format in Python 3.7 (https://bugs.python.org/issue30302). Adjust some tests to avoid relying on this.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:timedelta-repr into launchpad:master.
diff --git a/lib/lp/code/doc/codeimport.txt b/lib/lp/code/doc/codeimport.txt
index e5f1fa3..3856ed3 100644
--- a/lib/lp/code/doc/codeimport.txt
+++ b/lib/lp/code/doc/codeimport.txt
@@ -345,20 +345,20 @@ When the update interval interval is unspecified, the effective update
interval, which decides how often the import is actually updated, uses the
appropriate default value for the RCS type.
- >>> default_interval_cvs
- datetime.timedelta(0, 43200)
- >>> cvs_import.effective_update_interval
- datetime.timedelta(0, 43200)
+ >>> default_interval_cvs.total_seconds()
+ 43200.0
+ >>> cvs_import.effective_update_interval.total_seconds()
+ 43200.0
- >>> default_interval_subversion
- datetime.timedelta(0, 21600)
- >>> svn_import.effective_update_interval
- datetime.timedelta(0, 21600)
+ >>> default_interval_subversion.total_seconds()
+ 21600.0
+ >>> svn_import.effective_update_interval.total_seconds()
+ 21600.0
- >>> default_interval_git
- datetime.timedelta(0, 21600)
- >>> git_import.effective_update_interval
- datetime.timedelta(0, 21600)
+ >>> default_interval_git.total_seconds()
+ 21600.0
+ >>> git_import.effective_update_interval.total_seconds()
+ 21600.0
If the update interval is set, then it overrides the default value.
@@ -368,13 +368,13 @@ direct attribute modification. So we use removeSecurityProxy in this example.
>>> removeSecurityProxy(cvs_import).update_interval = (
... timedelta(seconds=7200))
- >>> cvs_import.effective_update_interval
- datetime.timedelta(0, 7200)
+ >>> cvs_import.effective_update_interval.total_seconds()
+ 7200.0
>>> removeSecurityProxy(svn_import).update_interval = (
... timedelta(seconds=3600))
- >>> svn_import.effective_update_interval
- datetime.timedelta(0, 3600)
+ >>> svn_import.effective_update_interval.total_seconds()
+ 3600.0
Retrieving CodeImports