[PATCH] Fix a couple other pylint problems in the driver disk tests.

Chris Lumens clumens at redhat.com
Thu Jul 9 14:23:26 UTC 2015


Most of this is just pylint not being able to import from the dracut/ directory
without being told how.  Most of the rest is ignoring the interruptible system
call stuff in contexts where it doesn't matter.
---
 dracut/driver_updates.py                  | 3 +++
 tests/dracut_tests/test_driver_updates.py | 6 ++++--
 tests/lib/mkdud.py                        | 6 +++++-
 tests/testenv.sh                          | 4 ++--
 4 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/dracut/driver_updates.py b/dracut/driver_updates.py
index 0bf9648..e50eae9 100755
--- a/dracut/driver_updates.py
+++ b/dracut/driver_updates.py
@@ -63,6 +63,9 @@ During system installation, anaconda will install the packages listed in
 /run/install/dd_packages to the target system.
 """
 
+# Ignore any interruptible calls
+# pylint: disable=interruptible-system-call
+
 import logging
 import sys
 import os
diff --git a/tests/dracut_tests/test_driver_updates.py b/tests/dracut_tests/test_driver_updates.py
index 9b87c73..d4387f3 100644
--- a/tests/dracut_tests/test_driver_updates.py
+++ b/tests/dracut_tests/test_driver_updates.py
@@ -1,5 +1,8 @@
 # test_driver_updates.py - unittests for driver_updates.py
 
+# Ignore any interruptible calls
+# pylint: disable=interruptible-system-call
+
 import unittest
 try:
     import unittest.mock as mock
@@ -231,7 +234,7 @@ class TestSaveRepo(FileTestCaseBase):
     def test_basic(self):
         """save_repo: copies a directory to /run/install/DD-X"""
         makerepo(self.srcdir)
-        [repo] = find_repos(self.srcdir)
+        repo = find_repos(self.srcdir)[0]
         makefile(repo+'/fake-something.rpm')
         saved = save_repo(repo, target=self.destdir)
         self.assertEqual(set(os.listdir(saved)), set(["fake-something.rpm"]))
@@ -584,7 +587,6 @@ class DeviceInfoTestCase(unittest.TestCase):
 # TODO: test TextMenu itself
 
 # py2/3 compat
-import sys
 if sys.version_info.major == 3:
     from io import StringIO
 else:
diff --git a/tests/lib/mkdud.py b/tests/lib/mkdud.py
index 1fb2b3c..3959ded 100755
--- a/tests/lib/mkdud.py
+++ b/tests/lib/mkdud.py
@@ -18,8 +18,12 @@
 #
 # Author: Will Woods <wwoods at redhat.com>
 
+# Ignore any interruptible calls
+# pylint: disable=interruptible-system-call
+
 import os
-import rpmfluff
+# TODO: this pragma is temporary until there's a python3-rpmfluff
+import rpmfluff         # pylint: disable=import-error
 import subprocess
 import argparse
 import tempfile
diff --git a/tests/testenv.sh b/tests/testenv.sh
index cdc7c41..4b7b236 100644
--- a/tests/testenv.sh
+++ b/tests/testenv.sh
@@ -9,9 +9,9 @@ fi
 : "${top_builddir:=$top_srcdir}"
 
 if [ -z "$PYTHONPATH" ]; then
-    PYTHONPATH="${top_builddir}/pyanaconda/isys/.libs:${top_srcdir}/pyanaconda:${top_srcdir}:${top_srcdir}/tests/lib"
+    PYTHONPATH="${top_builddir}/pyanaconda/isys/.libs:${top_srcdir}/pyanaconda:${top_srcdir}:${top_srcdir}/tests/lib:${top_srcdir}/dracut"
 else
-    PYTHONPATH="${PYTHONPATH}:${top_builddir}/pyanaconda/isys/.libs:${top_srcdir}/pyanaconda:${top_srcdir}:${top_srcdir}/tests/lib"
+    PYTHONPATH="${PYTHONPATH}:${top_builddir}/pyanaconda/isys/.libs:${top_srcdir}/pyanaconda:${top_srcdir}:${top_srcdir}/tests/lib:${top_srcdir}/dracut"
 fi
 
 if [ -z "$LD_LIBRARY_PATH" ]; then
-- 
2.4.3



More information about the anaconda-patches mailing list