[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/15] iotests: 'new' module replacement in 169
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 08/15] iotests: 'new' module replacement in 169 |
Date: |
Tue, 30 Oct 2018 21:31:13 -0300 |
From: Max Reitz <address@hidden>
iotest 169 uses the 'new' module to add methods to a class. This module
no longer exists in Python 3. Instead, we can use a lambda. Best of
all, this works in 2.7 just as well.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: Cleber Rosa <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
tests/qemu-iotests/169 | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/169 b/tests/qemu-iotests/169
index 69850c4c67..527aebd0cb 100755
--- a/tests/qemu-iotests/169
+++ b/tests/qemu-iotests/169
@@ -23,7 +23,6 @@ import iotests
import time
import itertools
import operator
-import new
import re
from iotests import qemu_img
@@ -204,7 +203,7 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase):
def inject_test_case(klass, name, method, *args, **kwargs):
mc = operator.methodcaller(method, *args, **kwargs)
- setattr(klass, 'test_' + method + name, new.instancemethod(mc, None,
klass))
+ setattr(klass, 'test_' + method + name, lambda self: mc(self))
for cmb in list(itertools.product((True, False), repeat=4)):
name = ('_' if cmb[0] else '_not_') + 'persistent_'
--
2.18.0.rc1.1.g3f1ff2140
- [Qemu-devel] [PULL 00/15] Python queue, 2018-10-30, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 03/15] iotests: Flush in iotests.py's QemuIoInteractive, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 01/15] scripts/device-crash-test: Remove devices that are not user_creatable anymore, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 02/15] iotests: Make nbd-fault-injector flush, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 05/15] iotests: Use // for Python integer division, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 04/15] iotests: Use Python byte strings where appropriate, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 07/15] iotests: Explicitly bequeath FDs in Python, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 06/15] iotests: Different iterator behavior in Python 3, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 08/15] iotests: 'new' module replacement in 169,
Eduardo Habkost <=
- [Qemu-devel] [PULL 09/15] iotests: Modify imports for Python 3, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 11/15] Bootstrap Python venv for tests, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 12/15] Acceptance tests: add make rule for running them, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 13/15] Travis support for the acceptance tests, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 14/15] scripts/decodetree.py: fix reference to attributes, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 15/15] scripts/qemu.py: use a more consistent docstring style, Eduardo Habkost, 2018/10/30
- [Qemu-devel] [PULL 10/15] iotests: Unify log outputs between Python 2 and 3, Eduardo Habkost, 2018/10/30