D5523: tests: get access to thirdparty.cbor without requiring it to be installed
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Wed Jan 9 18:08:53 EST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa9905045b992: tests: get access to thirdparty.cbor without requiring it to be installed (authored by durin42, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D5523?vs=13070&id=13116
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
More information about the Mercurial-devel
mailing list