Get py34 subunit.run test discovery to work

Currently the tox py34 target uses testtools.run to run
a subset of our test harness. We need to be able to use
pretty_tox.sh just like py27 as we make progress with py34
support.

The first step is to make sure we can discover all the
tests using:
python -m subunit.run discover -t . ./nova/tests/ --list

So, we need to fix a bunch of things for the discovery
to work including updating to a new version of websockify.

In the xen code, we should keep the original import and
add except for py34 as xen uses an older python that does
not work with six.moves.

Depends-On: Ib4ef2e79b28b7180e564b3d6dc2188456c66c08a
Change-Id: I88b6746da6136a7386a173f6cacd42f0b470deee
This commit is contained in:
Davanum Srinivas
2015-07-22 13:38:28 -05:00
committed by Davanum Srinivas (dims)
parent 5bb1933cc4
commit ed0196ebb6
23 changed files with 95 additions and 63 deletions

View File

@@ -13,7 +13,7 @@
# under the License.
import datetime
import StringIO
from six.moves import StringIO
from nova import context
from nova import exception
@@ -108,10 +108,10 @@ class FakeImageServiceTestCase(test.NoDBTestCase):
def test_create_then_get(self):
blob = 'some data'
s1 = StringIO.StringIO(blob)
s1 = StringIO(blob)
self.image_service.create(self.context,
{'id': '32', 'foo': 'bar'},
data=s1)
s2 = StringIO.StringIO()
s2 = StringIO()
self.image_service.download(self.context, '32', data=s2)
self.assertEqual(s2.getvalue(), blob, 'Did not get blob back intact')

View File

@@ -15,7 +15,7 @@
import datetime
import StringIO
from six.moves import StringIO
import glanceclient.exc
import mock
@@ -543,7 +543,7 @@ class TestDownloadNoDirectUri(test.NoDBTestCase):
class FakeDiskException(Exception):
pass
class Exceptionator(StringIO.StringIO):
class Exceptionator(StringIO):
def write(self, _):
raise FakeDiskException('Disk full!')

View File

@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import urlparse
import six.moves.urllib.parse as urlparse
import mock