Merge lp:~cjwatson/lazr.restful/py3-fix-test-web-service-request-is-versioned into lp:lazr.restful

Proposed by Colin Watson
Status: Merged
Merged at revision: 285
Proposed branch: lp:~cjwatson/lazr.restful/py3-fix-test-web-service-request-is-versioned
Merge into: lp:lazr.restful
Diff against target: 21 lines (+1/-3)
1 file modified
src/lazr/restful/tests/test_webservice.py (+1/-3)
To merge this branch: bzr merge lp:~cjwatson/lazr.restful/py3-fix-test-web-service-request-is-versioned
Reviewer Review Type Date Requested Status
Thiago F. Pappacena (community) Approve
Review via email: mp+396624@code.launchpad.net

Commit message

Fix test_web_service_request_is_versioned for Python 3.

Description of the change

It's not quite clear what it was trying to achieve with attrgetter, but a straightforward getattr test works.

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/lazr/restful/tests/test_webservice.py'
2--- src/lazr/restful/tests/test_webservice.py 2020-09-03 18:30:12 +0000
3+++ src/lazr/restful/tests/test_webservice.py 2021-01-21 00:38:03 +0000
4@@ -12,7 +12,6 @@
5 StringIO,
6 )
7 from lxml import etree
8-from operator import attrgetter
9 import collections
10 import logging
11 import random
12@@ -865,8 +864,7 @@
13
14 # A normal web browser request isn't associated with any version.
15 website_request = get_current_browser_request()
16- self.assertRaises(AttributeError,
17- attrgetter('version', website_request), None)
18+ self.assertRaises(AttributeError, getattr, website_request, 'version')
19
20 # But the result of get_current_web_service_request() is
21 # associated with version 2.0.

Subscribers

People subscribed via source and target branches