[Python-modules-commits] r33692 - in packages/checkbox-support/trunk/debian (5 files)
zyga-guest at users.alioth.debian.org
zyga-guest at users.alioth.debian.org
Tue Aug 11 10:48:08 UTC 2015
Date: Tuesday, August 11, 2015 @ 10:48:07
Author: zyga-guest
Revision: 33692
* debian/patches/fix-lp1483410-part1: Correct the method of loading unit
tests so that package modules are not loaded as top-level modules
themselves. (Closes LP: #1483410)
* debian/patches/fix-lp1483410-part2: Iterate over a copy of dictionary keys
so that the loop can correctly remove elements without raising exceptions.
* debian/control: build-depend on python3-dbus and python3-gi as apparently
tests are importing modules that depend on those.
Added:
packages/checkbox-support/trunk/debian/patches/fix-lp1483410-part1
packages/checkbox-support/trunk/debian/patches/fix-lp1483410-part2
Modified:
packages/checkbox-support/trunk/debian/changelog
packages/checkbox-support/trunk/debian/control
packages/checkbox-support/trunk/debian/patches/series
Modified: packages/checkbox-support/trunk/debian/changelog
===================================================================
--- packages/checkbox-support/trunk/debian/changelog 2015-08-11 07:38:59 UTC (rev 33691)
+++ packages/checkbox-support/trunk/debian/changelog 2015-08-11 10:48:07 UTC (rev 33692)
@@ -1,3 +1,15 @@
+checkbox-support (0.20-2) UNRELEASED; urgency=medium
+
+ * debian/patches/fix-lp1483410-part1: Correct the method of loading unit
+ tests so that package modules are not loaded as top-level modules
+ themselves. (Closes LP: #1483410)
+ * debian/patches/fix-lp1483410-part2: Iterate over a copy of dictionary keys
+ so that the loop can correctly remove elements without raising exceptions.
+ * debian/control: build-depend on python3-dbus and python3-gi as apparently
+ tests are importing modules that depend on those.
+
+ -- Zygmunt Krynicki <zygmunt.krynicki at canonical.com> Tue, 11 Aug 2015 11:49:15 +0200
+
checkbox-support (0.20-1) unstable; urgency=medium
* New upstream release
Modified: packages/checkbox-support/trunk/debian/control
===================================================================
--- packages/checkbox-support/trunk/debian/control 2015-08-11 07:38:59 UTC (rev 33691)
+++ packages/checkbox-support/trunk/debian/control 2015-08-11 10:48:07 UTC (rev 33692)
@@ -9,10 +9,12 @@
debhelper (>= 9),
dh-python,
python3-all,
+ python3-dbus,
+ python3-gi,
+ python3-lxml (>= 2.3),
python3-pkg-resources,
python3-pyparsing,
python3-setuptools,
- python3-lxml (>= 2.3)
Standards-Version: 3.9.6
X-Python3-Version: >= 3.2
XS-Testsuite: autopkgtest
Added: packages/checkbox-support/trunk/debian/patches/fix-lp1483410-part1
===================================================================
--- packages/checkbox-support/trunk/debian/patches/fix-lp1483410-part1 (rev 0)
+++ packages/checkbox-support/trunk/debian/patches/fix-lp1483410-part1 2015-08-11 10:48:07 UTC (rev 33692)
@@ -0,0 +1,29 @@
+Description: Fix LP: #1483410
+ This patch corrects a simple bug in the test suite loader that was previously
+ silently compesated by eariler versions of the standard library. The bug has
+ caused us to effectively import modules and pacakges from _inside_ the
+ checkbox_support package. For example, the module 'checkbox_support.dbus'
+ was imported simply as 'dbus'. This caused all kinds of understandable havoc.
+ The fix relies on the second, optional argument to defaultTestLoader.discover()
+ which lets us specify that we want to load 'checkbox_support' from the parent
+ directory.
+Author: Zygmunt Krynicki <zygmunt.krynicki at canonical.com>
+Origin: upstream
+Bug-Ubuntu: https://launchpad.net/bugs/1483410
+Forwarded: no
+Last-Update: 2015-08011
+
+--- checkbox-support-0.20.orig/checkbox_support/tests/__init__.py
++++ checkbox-support-0.20/checkbox_support/tests/__init__.py
+@@ -40,8 +40,9 @@ def load_unit_tests():
+ """
+ # Discover all unit tests. By simple convention those are kept in
+ # python modules that start with the word 'test_' .
+- return defaultTestLoader.discover(
+- os.path.dirname(getabsfile(checkbox_support)))
++ start_dir = os.path.dirname(getabsfile(checkbox_support))
++ top_level_dir = os.path.normpath(os.path.join(start_dir, '..'))
++ return defaultTestLoader.discover(start_dir, top_level_dir=top_level_dir)
+
+
+ def test_suite():
Added: packages/checkbox-support/trunk/debian/patches/fix-lp1483410-part2
===================================================================
--- packages/checkbox-support/trunk/debian/patches/fix-lp1483410-part2 (rev 0)
+++ packages/checkbox-support/trunk/debian/patches/fix-lp1483410-part2 2015-08-11 10:48:07 UTC (rev 33692)
@@ -0,0 +1,21 @@
+Description: Don't remove keys from dictionary being iterated
+ I'm not quite sure how this worked earlier but it's clearly wrong. This patch
+ simply makes the outer loop iterate over a copy of all the keys in the
+ self.devices dictionary. This makes the .pop() function a few lines below
+ function as expected.
+Author: Zygmunt Krynicki <zygmunt.krynicki at canonical.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1483410
+Forwarded: no
+Last-Update: 2015-08-11
+
+--- checkbox-support-0.20.orig/checkbox_support/parsers/udevadm.py
++++ checkbox-support-0.20/checkbox_support/parsers/udevadm.py
+@@ -803,7 +803,7 @@ class UdevadmParser(object):
+ self.devices[device._raw_path] = device
+ stack.append(device)
+
+- for device in self.devices.values():
++ for device in list(self.devices.values()):
+ if device.category in ("NETWORK", "WIRELESS", "OTHER"):
+ dev_interface = [
+ d for d in self.devices.values()
Modified: packages/checkbox-support/trunk/debian/patches/series
===================================================================
--- packages/checkbox-support/trunk/debian/patches/series 2015-08-11 07:38:59 UTC (rev 33691)
+++ packages/checkbox-support/trunk/debian/patches/series 2015-08-11 10:48:07 UTC (rev 33692)
@@ -1 +1,3 @@
unvendorize
+fix-lp1483410-part1
+fix-lp1483410-part2
More information about the Python-modules-commits
mailing list