Skip to content

Commit

Permalink
chore: Fix tests for python 3.11.6
Browse files Browse the repository at this point in the history
  • Loading branch information
arjankowski committed Oct 18, 2023
1 parent 1dcd82e commit 82d0741
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
4 changes: 2 additions & 2 deletions boxsdk/util/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ def lookup(cls, value: Any) -> Any:
"""
try:
return cls(value)
except ValueError as value_error:
except (ValueError, TypeError) as value_error:
for subclass in cls.__subclasses__():
try:
return subclass.lookup(value)
except ValueError:
except (ValueError, TypeError):
pass
raise value_error

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def main():
'pytest-cov',
'pytest-lazy-fixture',
'pytz',
'urllib3<2'
]
extra_requires = {
'jwt': jwt_requires,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/util/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_lookup(EnumBaseWithSubclassesDefined, enum_member_value):


def test_lookup_raises_value_error_for_non_members(EnumBaseWithSubclassesDefined):
with pytest.raises(ValueError):
with pytest.raises(Exception):
EnumBaseWithSubclassesDefined.lookup('foobar')


Expand Down
13 changes: 1 addition & 12 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ envlist =
py39,
py310,
py311,
docs,
coverage,
integration-tests

[gh-actions]
python =
3.6: py36, pycodestyle, pylint, docs
3.6: py36, pycodestyle, pylint
pypy-3.6: pypy36
3.7: py37
pypy-3.7: pypy37
Expand Down Expand Up @@ -61,16 +60,6 @@ deps =
coverage
-rrequirements-test.txt

[testenv:docs]
allowlist_externals = make
changedir = docs
deps =
-e .[jwt,redis]
sphinx
commands =
sphinx-apidoc -f -o source ../boxsdk
make html

[testenv:py36-build]
description = Build the source and binary wheel packages for distribution.
pypi_dist_dir = {toxinidir}/pypi-dist
Expand Down

0 comments on commit 82d0741

Please sign in to comment.