Clean up tests: Don't use MatchesListwise for a single-length list.
authorThomi Richards <thomi.richards@canonical.com>
Mon, 18 Nov 2013 19:24:45 +0000 (08:24 +1300)
committerThomi Richards <thomi.richards@canonical.com>
Mon, 18 Nov 2013 19:24:45 +0000 (08:24 +1300)
python/subunit/tests/test_output_filter.py

index 05b6267..fb56057 100644 (file)
@@ -23,7 +23,6 @@ from testtools.matchers import (
     Equals,
     Matcher,
     Mismatch,
-    MatchesListwise,
 )
 from testtools.testresult.doubles import StreamResult
 
@@ -94,10 +93,8 @@ class ByteStreamCompatibilityTests(TestCase):
         )
 
         self.assertThat(
-            result._events,
-            MatchesListwise([
-                MatchesCall(call='status', test_id='foo', test_status='inprogress'),
-            ])
+            result._events[0],
+            MatchesCall(call='status', test_id='foo', test_status='inprogress')
         )
 
     def test_pass_generates_success(self):
@@ -106,10 +103,8 @@ class ByteStreamCompatibilityTests(TestCase):
         )
 
         self.assertThat(
-            result._events,
-            MatchesListwise([
-                MatchesCall(call='status', test_id='foo', test_status='success'),
-            ])
+            result._events[0],
+            MatchesCall(call='status', test_id='foo', test_status='success')
         )
 
     def test_fail_generates_fail(self):
@@ -118,10 +113,8 @@ class ByteStreamCompatibilityTests(TestCase):
         )
 
         self.assertThat(
-            result._events,
-            MatchesListwise([
-                MatchesCall(call='status', test_id='foo', test_status='fail'),
-            ])
+            result._events[0],
+            MatchesCall(call='status', test_id='foo', test_status='fail')
         )
 
     def test_skip_generates_skip(self):
@@ -130,10 +123,8 @@ class ByteStreamCompatibilityTests(TestCase):
         )
 
         self.assertThat(
-            result._events,
-            MatchesListwise([
-                MatchesCall(call='status', test_id='foo', test_status='skip'),
-            ])
+            result._events[0],
+            MatchesCall(call='status', test_id='foo', test_status='skip')
         )