From 9a09b99ef286c47562ae321f7b88bbb554a10259 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Thu, 4 Apr 2024 17:39:49 -0500 Subject: [PATCH] Use platform-agnostic path manipulation in test_packages.py (#366) --- test/test_packages.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_packages.py b/test/test_packages.py index 72761d94..d5d45ae4 100644 --- a/test/test_packages.py +++ b/test/test_packages.py @@ -25,7 +25,7 @@ def _create_pkg_in_dir(path, version='0.1.0'): Foo Bar -""".format(path.split('/')[-1], version) +""".format(os.path.basename(path), version) with open(os.path.join(path, 'package.xml'), 'w+') as f: f.write(template) @@ -52,10 +52,10 @@ def test_find_packages_allowing_duplicates_with_no_packages(): @in_temporary_directory def test_find_packages_invalid_version(): version = ':{version}' - path = 'src/foo' + path = os.path.join('src', 'foo') _create_pkg_in_dir(path, version) try: - find_packages(path.split('/')[0]) + find_packages(os.path.dirname(path)) assert False, 'Must raise' except InvalidPackage as e: exception_message = str(e)