Replace dict.iterkeys with six.iterkeys to make PY3 compatible
Python3 do not use dict.iterkeys, which would raise AttributeError: 'dict' object has no attribute 'iterkeys'. Change-Id: I97e320eac9f2f0b2cb5cf34a1d3fc57e80e440ed Closes-Bug: #1596124
This commit is contained in:
parent
4b10efd855
commit
19d8df31fd
|
@ -42,6 +42,7 @@
|
||||||
"""Display a subunit stream through a colorized unittest test runner."""
|
"""Display a subunit stream through a colorized unittest test runner."""
|
||||||
|
|
||||||
import heapq
|
import heapq
|
||||||
|
import six
|
||||||
import subunit
|
import subunit
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
@ -276,7 +277,7 @@ class SubunitTestResult(testtools.TestResult):
|
||||||
self.stopTestRun()
|
self.stopTestRun()
|
||||||
|
|
||||||
def stopTestRun(self):
|
def stopTestRun(self):
|
||||||
for cls in list(self.results.iterkeys()):
|
for cls in list(six.iterkeys(self.results)):
|
||||||
self.writeTestCase(cls)
|
self.writeTestCase(cls)
|
||||||
self.stream.writeln()
|
self.stream.writeln()
|
||||||
self.writeSlowTests()
|
self.writeSlowTests()
|
||||||
|
|
Loading…
Reference in New Issue