durin42 created this revision.
durin42 added a reviewer: indygreg.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This makes the test a noop when run from a tarball, but in return we can stop
  shipping a library we don't use.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-cbor.py

CHANGE DETAILS

diff --git a/tests/test-cbor.py b/tests/test-cbor.py
--- a/tests/test-cbor.py
+++ b/tests/test-cbor.py
@@ -1,10 +1,19 @@
 from __future__ import absolute_import
 
+import os
+import sys
 import unittest
 
-from mercurial.thirdparty import (
-    cbor,
-)
+# TODO migrate to canned cbor test strings and stop using thirdparty.cbor
+tpp = os.path.normpath(os.path.join(os.path.dirname(__file__),
+                                    '..', 'mercurial', 'thirdparty'))
+if not os.path.exists(tpp):
+    # skip, not in a repo
+    sys.exit(80)
+sys.path[0:0] = [tpp]
+import cbor
+del sys.path[0]
+
 from mercurial.utils import (
     cborutil,
 )



To: durin42, indygreg, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to