[Request] [+ ] D8812: tests: virtualenv is only used on py2, rename and conditionalize
spectral (Kyle Lippincott)
phabricator at mercurial-scm.org
Fri Jul 24 22:24:18 UTC 2020
spectral created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
If I have I have the Debian `python3-virtualenv` package installed on my
machine, the import succeeds but then I receive an AttributeError because the
package is essentially completely different between py2 and py3, and
test-hghave fails.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D8812
AFFECTED FILES
tests/hghave.py
tests/test-install.t
CHANGE DETAILS
diff --git a/tests/test-install.t b/tests/test-install.t
--- a/tests/test-install.t
+++ b/tests/test-install.t
@@ -214,7 +214,7 @@
no problems detected
#endif
-#if no-py3 virtualenv
+#if py2virtualenv
Note: --no-site-packages is deprecated, but some places have an
ancient virtualenv from their linux distro or similar and it's not yet
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -886,8 +886,11 @@
return False
- at check("virtualenv", "Python virtualenv support")
-def has_virtualenv():
+ at check("py2virtualenv", "Python2 virtualenv support")
+def has_py2virtualenv():
+ if sys.version_info[0] != 2:
+ return False
+
try:
import virtualenv
To: spectral, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200724/49157636/attachment-0001.html>
More information about the Mercurial-patches
mailing list