Skip to content

Commit 5679fa5

Browse files
remote/client: replace manual place checks with helper method calls
Signed-off-by: Bastian Krause <[email protected]>
1 parent 1bd0f99 commit 5679fa5

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

labgrid/remote/client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,10 +669,7 @@ def check_matches(self, place):
669669

670670
async def acquire(self):
671671
"""Acquire a place, marking it unavailable for other clients"""
672-
place = self.get_place()
673-
if place.acquired:
674-
raise UserError(f"place {place.name} is already acquired by {place.acquired}")
675-
672+
place = self.get_idle_place()
676673
if not self.args.allow_unmatched:
677674
self.check_matches(place)
678675

tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def test_place_add_no_name(coordinator):
262262

263263
def test_place_del_no_name(coordinator):
264264
with pexpect.spawn('python -m labgrid.remote.client delete') as spawn:
265-
spawn.expect("name was not a string")
265+
spawn.expect("place pattern not specified")
266266
spawn.expect(pexpect.EOF)
267267
spawn.close()
268268
assert spawn.exitstatus != 0, spawn.before.strip()

0 commit comments

Comments
 (0)