Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Feb 14, 2024
1 parent f04c36f commit 6b26808
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,18 +232,23 @@ def test_enum_to_int():
def test_enum_overload_resolution():
"""When performing overload resolution, enums should not be silently
converted to floats"""
assert m.test_enum_overload_resolution(0.0, 0.0) == 'f(float, float)'
assert m.test_enum_overload_resolution(0, 0) == 'f(float, float)'
assert m.test_enum_overload_resolution(0.0, m.ScopedEnum.Two) == 'f(float, ScopedEnum)'
assert m.test_enum_overload_resolution(0, m.ScopedEnum.Two) == 'f(float, ScopedEnum)'
assert m.test_enum_overload_resolution(0.0, 0.0) == "f(float, float)"
assert m.test_enum_overload_resolution(0, 0) == "f(float, float)"
assert (
m.test_enum_overload_resolution(0.0, m.ScopedEnum.Two) == "f(float, ScopedEnum)"
)
assert (

Check failure on line 240 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 3.12 β€’ ubuntu-20.04 β€’ x64

test_enum_overload_resolution AssertionError: assert 'f(float, float)' == 'f(float, ScopedEnum)' - f(float, ScopedEnum) + f(float, float)

Check failure on line 240 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 3.11 β€’ ubuntu-20.04 β€’ x64

test_enum_overload_resolution AssertionError: assert 'f(float, float)' == 'f(float, ScopedEnum)' - f(float, ScopedEnum) + f(float, float)

Check failure on line 240 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 3.9 β€’ ubuntu-20.04 β€’ x64

test_enum_overload_resolution AssertionError: assert 'f(float, float)' == 'f(float, ScopedEnum)' - f(float, ScopedEnum) + f(float, float)

Check failure on line 240 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 3.10 β€’ ubuntu-20.04 β€’ x64

test_enum_overload_resolution AssertionError: assert 'f(float, float)' == 'f(float, ScopedEnum)' - f(float, ScopedEnum) + f(float, float)

Check failure on line 240 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 pypy-3.8 β€’ ubuntu-20.04 β€’ x64 -DPYBIND11_FINDPYTHON=ON

test_enum_overload_resolution AssertionError: assert 'f(float, float)' == 'f(float, ScopedEnum)' - f(float, ScopedEnum) + f(float, float)

Check failure on line 240 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 pypy-3.9 β€’ ubuntu-20.04 β€’ x64

test_enum_overload_resolution AssertionError: assert 'f(float, float)' == 'f(float, ScopedEnum)' - f(float, ScopedEnum) + f(float, float)
m.test_enum_overload_resolution(0, m.ScopedEnum.Two) == "f(float, ScopedEnum)"
)


def test_enum_to_float():
"""Passing an enum to a function taking a float should trigger a type error"""
with pytest.raises(TypeError) as execinfo:

Check failure on line 247 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 3.12 β€’ ubuntu-20.04 β€’ x64

test_enum_to_float Failed: DID NOT RAISE <class 'TypeError'>

Check failure on line 247 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 3.11 β€’ ubuntu-20.04 β€’ x64

test_enum_to_float Failed: DID NOT RAISE <class 'TypeError'>

Check failure on line 247 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 3.10 β€’ ubuntu-20.04 β€’ x64

test_enum_to_float Failed: DID NOT RAISE <class 'TypeError'>
m.test_enum_to_float(m.ScopedBoolEnum.TRUE)

Check failure on line 248 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 3.9 β€’ ubuntu-20.04 β€’ x64

test_enum_to_float Failed: DID NOT RAISE <class 'TypeError'>

Check failure on line 248 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 pypy-3.8 β€’ ubuntu-20.04 β€’ x64 -DPYBIND11_FINDPYTHON=ON

test_enum_to_float Failed: DID NOT RAISE <class 'TypeError'>

Check failure on line 248 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 pypy-3.9 β€’ ubuntu-20.04 β€’ x64

test_enum_to_float Failed: DID NOT RAISE <class 'TypeError'>
assert str(execinfo.value).startswith('TypeError: test_enum_to_float(): incompatible function arguments.')

assert str(execinfo.value).startswith(

Check failure on line 249 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 3.6 β€’ ubuntu-20.04 β€’ x64 -DPYBIND11_FINDPYTHON=ON -DCMAKE_CXX_FLAGS="-D_=1"

test_enum_to_float AssertionError: assert False + where False = <built-in method startswith of str object at 0x7f87ab1d4108>('TypeError: test_enum_to_float(): incompatible function arguments.') + where <built-in method startswith of str object at 0x7f87ab1d4108> = 'test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>'.startswith + where 'test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>' = str(TypeError('test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>',)) + where TypeError('test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>',) = <ExceptionInfo TypeError('test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>',) tblen=1>.value

Check failure on line 249 in tests/test_enum.py

View workflow job for this annotation

GitHub Actions / 🐍 pypy-3.10 β€’ ubuntu-20.04 β€’ x64

test_enum_to_float AssertionError: assert False + where False = <bound method str.startswith of 'test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>'>('TypeError: test_enum_to_float(): incompatible function arguments.') + where <bound method str.startswith of 'test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>'> = 'test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>'.startswith + where 'test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>' = str(TypeError('test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>')) + where TypeError('test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>') = <ExceptionInfo TypeError('test_enum_to_float(): incompatible function arguments. The following argument types are supported:\n 1. (arg0: float) -> None\n\nInvoked with: <ScopedBoolEnum.TRUE: 1>') tblen=1>.value
"TypeError: test_enum_to_float(): incompatible function arguments."
)


def test_duplicate_enum_name():
Expand Down

0 comments on commit 6b26808

Please sign in to comment.