Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix tests for python 3.11.6 #853

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading