Skip to content

Commit

Permalink
Merge pull request #1472 from xxNB/dev
Browse files Browse the repository at this point in the history
Remove unwanted None check for __repr__ in `Request` class
  • Loading branch information
yunstanford authored Jan 20, 2019
2 parents ef3c9ea + af7ad0a commit 2758a3a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions sanic/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ def __init__(self, url_bytes, headers, version, method, transport):
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
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def handler(request):
assert repr(request) == "<Request: GET />"

request.method = None
assert repr(request) == "<Request>"
assert repr(request) == "<Request: None />"


def test_request_bool(app):
Expand Down

0 comments on commit 2758a3a

Please sign in to comment.