Merge lp:~gocept/landscape-client/py3-fd into lp:~landscape/landscape-client/trunk

Proposed by Steffen Allner
Status: Merged
Approved by: Данило Шеган
Approved revision: 959
Merged at revision: 947
Proposed branch: lp:~gocept/landscape-client/py3-fd
Merge into: lp:~landscape/landscape-client/trunk
Prerequisite: lp:~gocept/landscape-client/python3
Diff against target: 21 lines (+2/-2)
1 file modified
landscape/lib/tests/test_fd.py (+2/-2)
To merge this branch: bzr merge lp:~gocept/landscape-client/py3-fd
Reviewer Review Type Date Requested Status
Geoff Teale (community) Approve
Alberto Donato (community) Approve
🤖 Landscape Builder test results Approve
Gocept Pending
Review via email: mp+319417@code.launchpad.net

Commit message

Support both Python2/3 in landscape.lib.fd module tests: range() returns a generator in python 3 where we want to compare whole lists.

Description of the change

We are on the journey to Python 2/3 compatibility.

This MP considers fixes a test for landscape.lib.fd module, as in python 3 `range()` returns a generator, but we want to compare the whole list.

To post a comment you must log in.
Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: TRIAL_ARGS=-j4 make check
Result: Success
Revno: 959
Branch: lp:~gocept/landscape-client/py3-fd
Jenkins: https://ci.lscape.net/job/latch-test-precise/897/

review: Approve (test results)
Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: TRIAL_ARGS=-j4 make check
Result: Success
Revno: 959
Branch: lp:~gocept/landscape-client/py3-fd
Jenkins: https://ci.lscape.net/job/latch-test-xenial/1461/

review: Approve (test results)
Revision history for this message
Alberto Donato (ack) wrote :

+1

review: Approve
Revision history for this message
Geoff Teale (tealeg) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'landscape/lib/tests/test_fd.py'
2--- landscape/lib/tests/test_fd.py 2016-06-15 20:14:49 +0000
3+++ landscape/lib/tests/test_fd.py 2017-03-09 10:11:32 +0000
4@@ -40,7 +40,7 @@
5
6 getrlimit_mock.assert_called_once_with(resource.RLIMIT_NOFILE)
7
8- expected_fds = range(3, 4096)
9+ expected_fds = list(range(3, 4096))
10 calls = [call(i) for i in expected_fds]
11 close_mock.assert_has_calls(calls, any_order=True)
12
13@@ -62,7 +62,7 @@
14 clean_fds()
15
16 getrlimit_mock.assert_called_once_with(resource.RLIMIT_NOFILE)
17- expected_fds = range(3, 10)
18+ expected_fds = list(range(3, 10))
19 calls = [call(i) for i in expected_fds]
20 close_mock.assert_has_calls(calls, any_order=True)
21 self.assertEqual(closed_fds, expected_fds)

Subscribers

People subscribed via source and target branches

to all changes: