From af7ad0a6212f2c8c7414f980107498c20b6728fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A0=E6=98=95?= Date: Thu, 17 Jan 2019 00:24:11 +0800 Subject: [PATCH] Remove unwanted None check for __repr__ in class --- sanic/request.py | 2 -- tests/test_requests.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sanic/request.py b/sanic/request.py index e0dd7173..4402dae5 100644 --- a/sanic/request.py +++ b/sanic/request.py @@ -115,8 +115,6 @@ class Request(dict): self.endpoint = None def __repr__(self): - if self.method is None or not self.path: - return "<{0}>".format(self.__class__.__name__) return "<{0}: {1} {2}>".format( self.__class__.__name__, self.method, self.path ) diff --git a/tests/test_requests.py b/tests/test_requests.py index 08c33b24..a7ebc831 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -566,7 +566,7 @@ def test_request_repr(app): assert repr(request) == "" request.method = None - assert repr(request) == "" + assert repr(request) == "" def test_request_bool(app):