Port test_matchers.TestDictMatches.test__str__ to Python 3
Method pprint.pformat(OrderedDict)'s output is different on Python 2 and Python 3. Its outputs equals "DictMatches({0})".format(OrderedDict) only on Python 2. Let's just use pprint.pformat. Partially-Implements: blueprint goal-python35 Change-Id: I220a7edf4f8f35ecb3763e4e3817c6c6c024efd9
This commit is contained in:
parent
4c05cb0913
commit
8f4dfdb55d
|
@ -12,6 +12,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
import pprint
|
||||||
|
|
||||||
import testtools
|
import testtools
|
||||||
from testtools.tests.matchers import helpers
|
from testtools.tests.matchers import helpers
|
||||||
|
@ -43,7 +44,7 @@ class TestDictMatches(testtools.TestCase, helpers.TestMatchersInterface):
|
||||||
]
|
]
|
||||||
|
|
||||||
str_examples = [
|
str_examples = [
|
||||||
("DictMatches({0})".format(matches_dict),
|
('DictMatches(%s)' % (pprint.pformat(matches_dict)),
|
||||||
matches_matcher),
|
matches_matcher),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ nova.tests.unit.compute.test_compute.ComputeAPITestCase.test_create_with_base64_
|
||||||
nova.tests.unit.compute.test_compute_cells.CellsComputeAPITestCase.test_create_with_base64_user_data
|
nova.tests.unit.compute.test_compute_cells.CellsComputeAPITestCase.test_create_with_base64_user_data
|
||||||
nova.tests.unit.compute.test_compute_mgr.ComputeManagerUnitTestCase.test_run_pending_deletes
|
nova.tests.unit.compute.test_compute_mgr.ComputeManagerUnitTestCase.test_run_pending_deletes
|
||||||
nova.tests.unit.compute.test_host_api.ComputeHostAPICellsTestCase
|
nova.tests.unit.compute.test_host_api.ComputeHostAPICellsTestCase
|
||||||
nova.tests.unit.test_matchers.TestDictMatches.test__str__
|
|
||||||
nova.tests.unit.test_wsgi.TestWSGIServerWithSSL
|
nova.tests.unit.test_wsgi.TestWSGIServerWithSSL
|
||||||
nova.tests.unit.virt.libvirt.storage.test_rbd.RbdTestCase
|
nova.tests.unit.virt.libvirt.storage.test_rbd.RbdTestCase
|
||||||
nova.tests.unit.virt.libvirt.test_firewall.IptablesFirewallTestCase
|
nova.tests.unit.virt.libvirt.test_firewall.IptablesFirewallTestCase
|
||||||
|
|
Loading…
Reference in New Issue