Skip to content

Commit

Permalink
Adapt test to warning
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrv committed Jul 24, 2024
1 parent 6fd7ac8 commit 87d7912
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unit/test_resources.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import os.path
import unittest
from pyiron_snippets.resources import ResourceNotFound, ResourceResolver, ExecutableResolver
from pyiron_snippets.resources import ResourceNotFound, ResourceResolver, ExecutableResolver, ResolverWarning
from pyiron_snippets.logger import logger

class TestResolvers(unittest.TestCase):
Expand Down Expand Up @@ -58,7 +58,7 @@ def test_executable(self):
res = ExecutableResolver([self.res1], code="code1", module="module1", suffix=suffix)
# Windows always reports the exec bit as set, so skip those tests there
if os.name != "nt":
with self.assertLogs(logger, level="WARNING"):
with self.assertWarns(ResolverWarning):
res.list()
self.assertNotIn("versionnonexec", res.available_versions,
"ExecutableResolver must not list scripts that are not executable.")
Expand Down

0 comments on commit 87d7912

Please sign in to comment.