D5083: tests: fix inline extension in test-fncache.t for Python 3

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sat Oct 13 09:10:53 EDT 2018


durin42 updated this revision to Diff 12077.
Herald added a reviewer: pulkit.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5083?vs=12076&id=12077

REVISION DETAIL
  https://phab.mercurial-scm.org/D5083

AFFECTED FILES
  contrib/python3-whitelist
  tests/test-fncache.t

CHANGE DETAILS

diff --git a/tests/test-fncache.t b/tests/test-fncache.t
--- a/tests/test-fncache.t
+++ b/tests/test-fncache.t
@@ -305,13 +305,13 @@
   > def trwrapper(orig, self, *args, **kwargs):
   >     tr = orig(self, *args, **kwargs)
   >     def fail(tr):
-  >         raise error.Abort("forced transaction failure")
+  >         raise error.Abort(b"forced transaction failure")
   >     # zzz prefix to ensure it sorted after store.write
-  >     tr.addfinalize('zzz-forcefails', fail)
+  >     tr.addfinalize(b'zzz-forcefails', fail)
   >     return tr
   > 
   > def abortwrapper(orig, self, *args, **kwargs):
-  >     raise error.Abort("forced transaction failure")
+  >     raise error.Abort(b"forced transaction failure")
   > 
   > def uisetup(ui):
   >     extensions.wrapfunction(localrepo.localrepository, 'transaction',
@@ -453,15 +453,15 @@
   > def extsetup(ui):
   >     def wrapstore(orig, requirements, *args):
   >         store = orig(requirements, *args)
-  >         if 'store' in requirements and 'fncache' in requirements:
+  >         if b'store' in requirements and b'fncache' in requirements:
   >             instrumentfncachestore(store, ui)
   >         return store
   >     extensions.wrapfunction(localrepo, 'makestore', wrapstore)
   > 
   > def instrumentfncachestore(fncachestore, ui):
   >     class instrumentedfncache(type(fncachestore.fncache)):
   >         def _load(self):
-  >             ui.warn('fncache load triggered!\n')
+  >             ui.warn(b'fncache load triggered!\n')
   >             super(instrumentedfncache, self)._load()
   >     fncachestore.fncache.__class__ = instrumentedfncache
   > EOF
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -201,6 +201,7 @@
 test-fix-topology.t
 test-fix.t
 test-flags.t
+test-fncache.t
 test-generaldelta.t
 test-getbundle.t
 test-git-export.t



To: durin42, #hg-reviewers, pulkit
Cc: mjpieters, mercurial-devel


More information about the Mercurial-devel mailing list