Patchwork [4,of,7] tests: replace imported module to avoid check-code.py error

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Feb. 17, 2019, 5:19 p.m.
Message ID <c1c8ae482985411a899c.1550423967@footprints>
Download mbox | patch
Permalink /patch/38803/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - Feb. 17, 2019, 5:19 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1550417245 -32400
#      Mon Feb 18 00:27:25 2019 +0900
# Node ID c1c8ae482985411a899cced234c2ef07d508c356
# Parent  d294202804a296c3f03e1c013886c5c1f174be6c
# Available At https://bitbucket.org/foozy/mercurial-wip
#              hg pull https://bitbucket.org/foozy/mercurial-wip -r c1c8ae482985
# EXP-Topic tests-fix-check-code-errors
tests: replace imported module to avoid check-code.py error

This is a part of preparation to apply checking with check-code.py on
code fragments embedded in *.t test scripts.

Patch

diff --git a/tests/test-status.t b/tests/test-status.t
--- a/tests/test-status.t
+++ b/tests/test-status.t
@@ -290,7 +290,7 @@  hg status -A:
 
   $ hg status -A -Tpickle > pickle
   >>> from __future__ import print_function
-  >>> import pickle
+  >>> from mercurial.util import pickle
   >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb")))
   >>> for s, p in data: print("%s %s" % (s, p))
   ! deleted