Skip to content

Commit

Permalink
test: Wrap optional library tests with skiptest.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaqx0r committed Jun 3, 2023
1 parent 4f9d297 commit 60b8886
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion nss_cache/sources/gcssource_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
from nss_cache.maps import group
from nss_cache.maps import passwd
from nss_cache.maps import shadow
from nss_cache.sources import gcssource
from nss_cache.util import file_formats
from nss_cache.util import timestamps

try:
from nss_cache.sources import gcssource
except Exception as e:
raise unittest.SkipTest("`gcssource` unabled to be imported: {}".format(e))


class TestGcsSource(unittest.TestCase):
def setUp(self):
Expand Down
6 changes: 5 additions & 1 deletion nss_cache/sources/s3source_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
from nss_cache.maps import group
from nss_cache.maps import passwd
from nss_cache.maps import shadow
from nss_cache.sources import s3source

try:
from nss_cache.sources import s3source
except Exception as e:
raise unittest.SkipTest("s3source unable to be imported: {}".format(e))


class TestS3Source(unittest.TestCase):
Expand Down

0 comments on commit 60b8886

Please sign in to comment.