Skip to content

Signature tests not catching missing keyword arguments #175

Closed
@asmeurer

Description

@asmeurer

For array_api_compat.torch, the triu function is missing the k keyword argument. But none of the tests catch this:

array_api_tests/test_has_names.py::test_has_names[creation-triu] PASSED                                                                                           [ 50%]
array_api_tests/test_signatures.py::test_func_signature[triu] SKIPPED (Signature for triu() is not inspectable and is too troublesome to test for otherwise)      [100%]

This is a great example of something that the old signature tests would handle just fine. I just tested it in 2022.03.22, the version before #110 was merged, and it finds the error just fine.

E               AssertionError: Unexpected exception TypeError("triu() got an unexpected keyword argument 'k'"): triu() should accept the keyword-only argument 'k'

So let's please just reintroduce these old signature tests as a fallback. They are much better than nothing and hardly "too troublesome". We are missing real bugs because of this.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions