Skip to content

Commit

Permalink
Fix line-too-long CodeFactor warning
Browse files Browse the repository at this point in the history
  • Loading branch information
joeycarter committed Nov 14, 2024
1 parent d3f9adc commit 9522424
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions frontend/test/pytest/test_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,11 @@ def identity(arg) -> int:
def cir(x):
return identity(x)

# NOTE: Currently, this will raise a TypeError exception on Linux and the same exception wrapped
# as a RuntimeError on macOS. This appears to be related to using nanobind for the Python/C++
# bindings. To avoid separate test cases for Linux and macOS, we accept either exception type
# here and match on the string below, which should be contained in the messages of both.
# NOTE: Currently, this will raise a TypeError exception on Linux and the same exception
# wrapped as a RuntimeError on macOS. This appears to be related to using nanobind for the
# Python/C++ bindings. To avoid separate test cases for Linux and macOS, we accept either
# exception type here and match on the string below, which should be contained in the messages
# of both.
# TODO: Why does this happen?
with pytest.raises((TypeError, RuntimeError), match="Callback identity expected type"):
cir(arg)
Expand Down Expand Up @@ -339,10 +340,11 @@ def cir(x):
captured = capsys.readouterr()
assert captured.out.strip() == ""

# NOTE: Currently, this will raise a ValueError exception on Linux and the same exception wrapped
# as a RuntimeError on macOS. This appears to be related to using nanobind for the Python/C++
# bindings. To avoid separate test cases for Linux and macOS, we accept either exception type
# here and match on the string below, which should be contained in the messages of both.
# NOTE: Currently, this will raise a ValueError exception on Linux and the same exception
# wrapped as a RuntimeError on macOS. This appears to be related to using nanobind for the
# Python/C++ bindings. To avoid separate test cases for Linux and macOS, we accept either
# exception type here and match on the string below, which should be contained in the messages
# of both.
# TODO: Why does this happen?
with pytest.raises(
(ValueError, RuntimeError), match="debug.callback is expected to return None"
Expand Down Expand Up @@ -965,10 +967,11 @@ def result(x):
return jnp.sum(some_func(jnp.sin(x)))

x = 0.435
# NOTE: Currently, this will raise a TypeError exception on Linux and the same exception wrapped
# as a RuntimeError on macOS. This appears to be related to using nanobind for the Python/C++
# bindings. To avoid separate test cases for Linux and macOS, we accept either exception type
# here and match on the string below, which should be contained in the messages of both.
# NOTE: Currently, this will raise a TypeError exception on Linux and the same exception
# wrapped as a RuntimeError on macOS. This appears to be related to using nanobind for the
# Python/C++ bindings. To avoid separate test cases for Linux and macOS, we accept either
# exception type here and match on the string below, which should be contained in the messages
# of both.
# TODO: Why does this happen?
with pytest.raises((TypeError, RuntimeError), match="Callback some_func expected type"):
result(x)
Expand Down

0 comments on commit 9522424

Please sign in to comment.