diff options
author | Jelmer Vernooij <jelmer@jelmer.uk> | 2023-02-02 20:57:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-02 20:57:02 +0000 |
commit | e40507dfb292de805fcbd125594579c40e5165a8 (patch) | |
tree | 0d611cafadf455cce6c8bb208da4acd2ff05ea25 /python/subunit/tests/test_test_protocol.py | |
parent | f5f90c27361ed8b5a2d0809edc979b49ccbc4fac (diff) | |
parent | 15fc58f06240f99d0652283b16787dcaa4d74e28 (diff) | |
download | subunit-git-e40507dfb292de805fcbd125594579c40e5165a8.tar.gz |
Merge pull request #66 from jelmer/pyupgrade
Upgrade code to a modern version (3.x+)
Diffstat (limited to 'python/subunit/tests/test_test_protocol.py')
-rw-r--r-- | python/subunit/tests/test_test_protocol.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py index d97f66d..a40591e 100644 --- a/python/subunit/tests/test_test_protocol.py +++ b/python/subunit/tests/test_test_protocol.py @@ -356,7 +356,7 @@ class TestTestProtocolServerLostConnection(unittest.TestCase): def do_connection_lost(self, outcome, opening): self.protocol.lineReceived(_b("test old mcdonald\n")) - self.protocol.lineReceived(_b("%s old mcdonald %s" % (outcome, opening))) + self.protocol.lineReceived(_b("{} old mcdonald {}".format(outcome, opening))) self.protocol.lostConnection() failure = subunit.RemoteError( _u("lost connection during %s report of test 'old mcdonald'") % @@ -933,13 +933,13 @@ class TestTestProtocolServerStreamTags(unittest.TestCase): def test_initial_tags(self): self.protocol.lineReceived(_b("tags: foo bar:baz quux\n")) self.assertEqual([ - ('tags', set(["foo", "bar:baz", "quux"]), set()), + ('tags', {"foo", "bar:baz", "quux"}, set()), ], self.client._events) def test_minus_removes_tags(self): self.protocol.lineReceived(_b("tags: -bar quux\n")) self.assertEqual([ - ('tags', set(["quux"]), set(["bar"])), + ('tags', {"quux"}, {"bar"}), ], self.client._events) def test_tags_do_not_get_set_on_test(self): @@ -1174,7 +1174,7 @@ class TestIsolatedTestSuite(TestCase): class TestTestProtocolClient(TestCase): def setUp(self): - super(TestTestProtocolClient, self).setUp() + super().setUp() self.io = BytesIO() self.protocol = subunit.TestProtocolClient(self.io) self.unicode_test = PlaceHolder(_u('\u2603')) @@ -1411,15 +1411,15 @@ class TestTestProtocolClient(TestCase): self.assertEqual(_b(""), self.io.getvalue()) def test_tags_add(self): - self.protocol.tags(set(['foo']), set()) + self.protocol.tags({'foo'}, set()) self.assertEqual(_b("tags: foo\n"), self.io.getvalue()) def test_tags_both(self): - self.protocol.tags(set(['quux']), set(['bar'])) + self.protocol.tags({'quux'}, {'bar'}) self.assertThat( [b"tags: quux -bar\n", b"tags: -bar quux\n"], Contains(self.io.getvalue())) def test_tags_gone(self): - self.protocol.tags(set(), set(['bar'])) + self.protocol.tags(set(), {'bar'}) self.assertEqual(_b("tags: -bar\n"), self.io.getvalue()) |