Yaniv Bronhaim has uploaded a new change for review.

Change subject: Adding python3 run for nosetests
......................................................................

Adding python3 run for nosetests

This patch adds list of nosetests modules that makecheck will try to run
with python3. The initial work will allow to add more verified tests to
that list until covering all of them.

Change-Id: I83355cce2af9125e6f017017905056956cd17081
Signed-off-by: Yaniv Bronhaim <ybron...@redhat.com>
---
M lib/vdsm/utils.py
M tests/Makefile.am
M tests/testlib.py
3 files changed, 14 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/48051/1

diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index 31d8529..bc3f0ff 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -30,7 +30,10 @@
 from collections import namedtuple, deque
 from contextlib import contextmanager
 from fnmatch import fnmatch
-from StringIO import StringIO
+try:
+    from StringIO import StringIO
+except ImportError:
+    from io import StringIO
 from weakref import proxy
 from .compat import pickle
 import distutils.spawn
@@ -54,7 +57,6 @@
 import time
 import vdsm.infra.zombiereaper as zombiereaper
 
-from cpopen import CPopen
 from . import cmdutils
 from . import constants
 
@@ -635,6 +637,7 @@
     a temporary thread, spawn a sync=False sub-process, and have the thread
     finish, the new subprocess would die immediately.
     """
+    from cpopen import CPopen
 
     command = cmdutils.wrap_command(command, with_ioclass=ioclass,
                                     ioclassdata=ioclassdata, with_nice=nice,
@@ -815,7 +818,7 @@
     return __hostUUID
 
 symbolerror = {}
-for code, symbol in errno.errorcode.iteritems():
+for code, symbol in six.iteritems(errno.errorcode):
     symbolerror[os.strerror(code)] = symbol
 
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7a7e10d..205289e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -26,6 +26,12 @@
          integration \
          $(NULL)
 
+test_modules_python3 = \
+       apiData.py \
+       cmdutilsTests.py \
+       concurrentTests.py \
+       $(NULL)
+
 device_modules = \
        devices/parsing/complex_vm_tests.py \
        $(NULL)
@@ -226,3 +232,4 @@
        @echo '*** into your environment.  Do not submit untested code!    ***'
        $(top_srcdir)/tests/run_tests_local.sh crossImportsTests.py
        $(top_srcdir)/tests/run_tests_local.sh $(test_modules) $(device_modules)
+       PYTHON_EXE=python3 $(top_srcdir)/tests/run_tests_local.sh 
$(test_modules_python3)
diff --git a/tests/testlib.py b/tests/testlib.py
index 3d00c0c..c3417fe 100644
--- a/tests/testlib.py
+++ b/tests/testlib.py
@@ -19,7 +19,6 @@
 #
 
 import errno
-import ConfigParser
 import functools
 import logging
 import os
@@ -27,6 +26,7 @@
 import unittest
 from functools import wraps
 import shutil
+from six.moves import configparser as ConfigParser
 import sys
 import tempfile
 import threading


-- 
To view, visit https://gerrit.ovirt.org/48051
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83355cce2af9125e6f017017905056956cd17081
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybron...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to