From b00b8ea0c11ab74667f64729240fb8c5e1c004f8 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 5 Apr 2020 02:39:44 +0200 Subject: [PATCH] Use byte literals instead of encode in tests (#33672) --- tests/components/graphite/test_init.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/components/graphite/test_init.py b/tests/components/graphite/test_init.py index dd60f03cd58..696d642cf86 100644 --- a/tests/components/graphite/test_init.py +++ b/tests/components/graphite/test_init.py @@ -172,9 +172,9 @@ class TestGraphite(unittest.TestCase): assert sock.connect.call_count == 1 assert sock.connect.call_args == mock.call(("foo", 123)) assert sock.sendall.call_count == 1 - assert sock.sendall.call_args == mock.call("foo".encode("ascii")) + assert sock.sendall.call_args == mock.call(b"foo") assert sock.send.call_count == 1 - assert sock.send.call_args == mock.call("\n".encode("ascii")) + assert sock.send.call_args == mock.call(b"\n") assert sock.close.call_count == 1 assert sock.close.call_args == mock.call()