From 61117441e13ed63dd4a706089d5e7e8791d9b2c4 Mon Sep 17 00:00:00 2001 From: Erik Flodin Date: Sun, 24 Nov 2024 20:55:40 +0100 Subject: [PATCH] test_unit_parse_encrypt: skip double star test when running on mac Since the included bash version on mac doesn't support double star. --- test/test_unit_parse_encrypt.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/test/test_unit_parse_encrypt.py b/test/test_unit_parse_encrypt.py index 6a5c23bf..fa717842 100644 --- a/test/test_unit_parse_encrypt.py +++ b/test/test_unit_parse_encrypt.py @@ -1,5 +1,7 @@ """Unit tests: parse_encrypt""" +import sys + import pytest @@ -123,16 +125,17 @@ def create_test_encrypt_data(paths): expected.add("ex ex/file4") expected.add("ex ex/file6.text") - # double star - edata += "doublestar/**/file*\n" - edata += "!**/file3\n" - paths.work.join("doublestar/a/b/file1").write("", ensure=True) - paths.work.join("doublestar/c/d/file2").write("", ensure=True) - paths.work.join("doublestar/e/f/file3").write("", ensure=True) - paths.work.join("doublestar/g/h/nomatch").write("", ensure=True) - expected.add("doublestar/a/b/file1") - expected.add("doublestar/c/d/file2") - # doublestar/e/f/file3 is excluded + # double star (not supported on bash 3 which is the default on macOS) + if sys.platform != "darwin": + edata += "doublestar/**/file*\n" + edata += "!**/file3\n" + paths.work.join("doublestar/a/b/file1").write("", ensure=True) + paths.work.join("doublestar/c/d/file2").write("", ensure=True) + paths.work.join("doublestar/e/f/file3").write("", ensure=True) + paths.work.join("doublestar/g/h/nomatch").write("", ensure=True) + expected.add("doublestar/a/b/file1") + expected.add("doublestar/c/d/file2") + # doublestar/e/f/file3 is excluded return edata, expected