From 8c4882adffb8b46346f159a988df1ce0914a494f Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Thu, 9 Nov 2023 21:50:38 +0100 Subject: [PATCH] Add a test that the `newaxis` constant exists The spec says that this has to be an alias to None, so verify that. --- array_api_tests/test_constants.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/array_api_tests/test_constants.py b/array_api_tests/test_constants.py index 606bf897..51c02714 100644 --- a/array_api_tests/test_constants.py +++ b/array_api_tests/test_constants.py @@ -51,3 +51,8 @@ def test_nan(): x = xp.asarray(xp.nan) assert_0d_float("nan", x) assert xp.isnan(x), "xp.isnan(xp.asarray(xp.nan))=False" + + +def test_newaxis(): + assert hasattr(xp, "newaxis") + assert xp.newaxis is None