Patchwork tests: update test-command-template to pass our import checker

login
register
mail settings
Submitter Augie Fackler
Date Aug. 25, 2017, 3:28 p.m.
Message ID <d0b32a5f82e4e278e05e.1503674926@imladris.local>
Download mbox | patch
Permalink /patch/23342/
State Accepted
Headers show

Comments

Augie Fackler - Aug. 25, 2017, 3:28 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1503431394 14400
#      Tue Aug 22 15:49:54 2017 -0400
# Node ID d0b32a5f82e4e278e05e6363997bb79510aa9717
# Parent  bcbb163bf16907feefb69363b5540d6b2e5c8028
tests: update test-command-template to pass our import checker

Patch

diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -2166,9 +2166,10 @@  Age filter:
   $ cd unstable-hash
   $ hg log --template '{date|age}\n' > /dev/null || exit 1
 
-  >>> from datetime import datetime, timedelta
+  >>> from __future__ import absolute_import
+  >>> import datetime
   >>> fp = open('a', 'w')
-  >>> n = datetime.now() + timedelta(366 * 7)
+  >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
   >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day))
   >>> fp.close()
   $ hg add a