← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~lgp171188/launchpad:drop-bionic-readline-mock-for-tests into launchpad:master

 

Guruprasad has proposed merging ~lgp171188/launchpad:drop-bionic-readline-mock-for-tests into launchpad:master.

Commit message:
Drop the readline mock in the test environment for bionic                                                                                                                                    

We do not use or care about bionic any more.


Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lgp171188/launchpad/+git/launchpad/+merge/452432
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad:drop-bionic-readline-mock-for-tests into launchpad:master.
diff --git a/lib/lp/scripts/utilities/test.py b/lib/lp/scripts/utilities/test.py
index 93d16cf..7685852 100755
--- a/lib/lp/scripts/utilities/test.py
+++ b/lib/lp/scripts/utilities/test.py
@@ -23,9 +23,7 @@ import signal
 import sys
 import time
 import warnings
-from unittest import mock
 
-import distro
 import six
 from zope.testrunner import options
 from zope.testrunner.feature import Feature
@@ -91,21 +89,6 @@ def configure_environment():
     # Suppress accessibility warning because the test runner does not have UI.
     os.environ["GTK_MODULES"] = ""
 
-    if distro.linux_distribution()[:2] == ("Ubuntu", "18.04"):
-        # XXX cjwatson 2020-10-09: Certain versions of Python crash when
-        # importing readline into a process that has libedit loaded
-        # (https://bugs.python.org/issue38634,
-        # https://bugs.launchpad.net/bugs/1899076), so stub out readline to
-        # prevent this.  This unfortunately makes debugging less pleasant.
-        #
-        # So far the only LTS version of Ubuntu that exhibits this behaviour
-        # is 18.04; 16.04 doesn't seem to end up loading libedit because its
-        # libGL is laid out differently in a way that doesn't end up loading
-        # libedit, and 20.04 has the Python bug fixed.  We should drop this
-        # once 18.04 is fixed or once we no longer care about it, since this
-        # workaround is pretty nasty.
-        sys.modules["readline"] = mock.Mock()
-
 
 def filter_warnings():
     # Silence spurious warnings. Note that this does not propagate to