Skip to content

Commit

Permalink
fix 3.13 test runners (#1976)
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonvt authored Oct 13, 2024
1 parent afe5da2 commit 05eadc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
extras: "-E pandas"
- name: Linting and static code checks
run: pre-commit run --all-files
run: pre-commit run --all-files --show-diff-on-failure

build_docs:
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions tests/tests_unit/test_data_classes/test_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,12 @@ def test_idscopes_camel_case():

@pytest.mark.parametrize("capability", Capability.__subclasses__())
def test_show_example_usage(capability):
# This test ensures that the example usage given in error messages etc. works by executing it.
if capability is UnknownAcl:
assert not capability.show_example_usage()
elif capability is capabilities_module.LegacyCapability:
pytest.skip("LegacyCapability is abstract")
else:
cmd = capability.show_example_usage()[15:] # TODO PY39: .removeprefix
exec(f"{capability.__name__} = capabilities_module.{capability.__name__}")
cmd = capability.show_example_usage().removeprefix("Example usage: ")
exec(f"{capability.__name__} = capabilities_module.{capability.__name__}", globals())
exec(cmd)

0 comments on commit 05eadc9

Please sign in to comment.