fix: avoid dtype comparison for None report metadata - #448
Merged
Conversation
Member
|
I've to admit this looks a bit overboard. If the problem is that $ git diff
diff --git a/reporting.py b/reporting.py
index 579aa21..0dcf410 100644
--- a/reporting.py
+++ b/reporting.py
@@ -17,6 +17,8 @@ except ImportError:
raise ImportError("pytest-json-report is required to run the array API tests")
def to_json_serializable(o):
+ if o is None:
+ return o
if o in dtype_to_name:
return dtype_to_name[o]
if isinstance(o, (BuiltinFunctionType, FunctionType, type)):
|
Member
|
Actually, scratch that. Need some more coffee, sorry. Now that I re-read the function itself, my diff above is the same fix. |
ev-br
marked this pull request as ready for review
August 9, 2026 11:18
|
@ev-br happens to the best of us 😭 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Nonewith array-library dtype objects before looking them up indtype_to_nameNoneCloses #447
Validation
ARRAY_API_TESTS_MODULE=numpy PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -q -p pytest_jsonreport.plugin meta_tests/test_reporting.pypassed: 1 testARRAY_API_TESTS_MODULE=numpy PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -q -p pytest_jsonreport.plugin meta_tests/test_utils.pypassed: 30 testspython -m compileall -q reporting.py meta_tests/test_reporting.pypassedgit diff --checkpassedThe full suite was not run. The focused commands disable unrelated globally installed pytest plugins and load the repository's JSON-report plugin explicitly.