Skip to content
Open
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
11 changes: 10 additions & 1 deletion chex/_src/asserts_chexify_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,19 @@ def logp1_abs_safe(x):
asserts_chexify.block_until_chexify_assertions_complete()

err_regex = re.escape(_ai.get_chexify_err_message('assert_tree_all_finite'))
with self.assertRaisesRegex(AssertionError, f'{err_regex}.*chexify_test'):

# On Windows, JAX traceback filtering drops the user-frame filename.
expected_regex = (
err_regex if sys.platform == "win32"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update the quote delimiters to fix the CI

else f"{err_regex}.*chexify_test"
)

with self.assertRaisesRegex(AssertionError, expected_regex):
logp1_abs_safe(jnp.array([jnp.nan, 3])) # FAILS
logp1_abs_safe.wait_checks() # pytype: disable=attribute-error



def test_checkify_errors(self):
@jax.jit
def take_by_index_and_div(x, i, y):
Expand Down
Loading