Skip to content

Commit 3fca3fe

Browse files
authored
chore: Fix tests for python 3.11.6 (#853)
1 parent 1dcd82e commit 3fca3fe

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

boxsdk/util/enum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ def lookup(cls, value: Any) -> Any:
6565
"""
6666
try:
6767
return cls(value)
68-
except ValueError as value_error:
68+
except (ValueError, TypeError) as value_error:
6969
for subclass in cls.__subclasses__():
7070
try:
7171
return subclass.lookup(value)
72-
except ValueError:
72+
except (ValueError, TypeError):
7373
pass
7474
raise value_error
7575

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def main():
7373
'pytest-cov',
7474
'pytest-lazy-fixture',
7575
'pytz',
76+
'urllib3<2'
7677
]
7778
extra_requires = {
7879
'jwt': jwt_requires,

test/unit/util/test_enum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def test_lookup(EnumBaseWithSubclassesDefined, enum_member_value):
107107

108108

109109
def test_lookup_raises_value_error_for_non_members(EnumBaseWithSubclassesDefined):
110-
with pytest.raises(ValueError):
110+
with pytest.raises(Exception):
111111
EnumBaseWithSubclassesDefined.lookup('foobar')
112112

113113

tox.ini

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ envlist =
1616
py39,
1717
py310,
1818
py311,
19-
docs,
2019
coverage,
2120
integration-tests
2221

2322
[gh-actions]
2423
python =
25-
3.6: py36, pycodestyle, pylint, docs
24+
3.6: py36, pycodestyle, pylint
2625
pypy-3.6: pypy36
2726
3.7: py37
2827
pypy-3.7: pypy37
@@ -61,16 +60,6 @@ deps =
6160
coverage
6261
-rrequirements-test.txt
6362

64-
[testenv:docs]
65-
allowlist_externals = make
66-
changedir = docs
67-
deps =
68-
-e .[jwt,redis]
69-
sphinx
70-
commands =
71-
sphinx-apidoc -f -o source ../boxsdk
72-
make html
73-
7463
[testenv:py36-build]
7564
description = Build the source and binary wheel packages for distribution.
7665
pypi_dist_dir = {toxinidir}/pypi-dist

0 commit comments

Comments
 (0)