Skip to content
Snippets Groups Projects
Verified Commit 8c2b0797 authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

tests/test_tools: fix test if /sbin contains a directory


The test_sbin_added_to_path test would then fail with an unhelpful
message (diffoscope.exc.RequiredToolNotFound: name_of_the_subdir) if
/sbin contains a subdirectory and os.listdir() returned it as the first
member.

Fixes: MR: !2
Thanks: Chris Lamb <lamby@debian.org> for the patch
Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 7bd7e1f1
No related branches found
No related tags found
No related merge requests found
Pipeline #12671 failed
......@@ -24,7 +24,9 @@ import pytest
def test_sbin_added_to_path():
from diffoscope.tools import tool_required
@tool_required(os.listdir('/sbin')[0])
_, _, filenames = list(os.walk('/sbin'))[0]
@tool_required(filenames[0])
def fn():
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment