Merge ~r00ta/maas:cleanup-runtimeerorr-import into maas:master

Proposed by Jacopo Rota
Status: Merged
Approved by: Jacopo Rota
Approved revision: 52e7288e014b21cb5521272d060630f7081717ec
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~r00ta/maas:cleanup-runtimeerorr-import
Merge into: maas:master
Diff against target: 30 lines (+3/-6)
1 file modified
src/maasserver/tests/test_dhcp.py (+3/-6)
Reviewer Review Type Date Requested Status
MAAS Lander Approve
Anton Troyanov Approve
Review via email: mp+452223@code.launchpad.net

Commit message

refactor: cleanup imports in test_dhcp

Description of the change

Remove leftover `import builtins`

To post a comment you must log in.
Revision history for this message
Anton Troyanov (troyanov) :
review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b cleanup-runtimeerorr-import lp:~r00ta/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas-tester/3646/console
COMMIT: 21a05fb6543a375483a516517c03b37387cfdfec

review: Needs Fixing
52e7288... by Jacopo Rota

lint

Revision history for this message
Dima Tisnek (dimaqq) wrote :

LGTM

Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b cleanup-runtimeerorr-import lp:~r00ta/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 52e7288e014b21cb5521272d060630f7081717ec

review: Approve

Update scan failed

At least one of the branches involved have failed to scan. You can manually schedule a rescan if required.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/tests/test_dhcp.py b/src/maasserver/tests/test_dhcp.py
2index 1f6dab3..346a808 100644
3--- a/src/maasserver/tests/test_dhcp.py
4+++ b/src/maasserver/tests/test_dhcp.py
5@@ -1,6 +1,5 @@
6 # Copyright 2012-2021 Canonical Ltd. This software is licensed under the
7 # GNU Affero General Public License version 3 (see the file LICENSE).
8-import builtins
9 from datetime import datetime
10 from operator import itemgetter
11 import random
12@@ -2858,15 +2857,13 @@ class TestConfigureDHCP(MAASTransactionServerTestCase):
13 client = yield getClientFor(rack_controller.system_id)
14 self.patch(
15 client._conn, "_sendBoxCommand"
16- ).side_effect = always_fail_with(
17- builtins.RuntimeError("the handler is closed")
18- )
19+ ).side_effect = always_fail_with(RuntimeError("the handler is closed"))
20
21 ipv4_stub.side_effect = always_succeed_with({})
22 ipv6_stub.side_effect = always_succeed_with({})
23
24- # The builtins.RuntimeError is propagated
25- with pytest.raises(builtins.RuntimeError):
26+ # The RuntimeError is propagated
27+ with pytest.raises(RuntimeError):
28 yield dhcp.configure_dhcp(rack_controller)
29
30 # But the connection should have been closed and no connections should be available now.

Subscribers

People subscribed via source and target branches