Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Specify dependency of each test case

Đang mở
#51 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
testing, tooling

Hướng nghiên cứu

Bắt đầu bằng việc xem xét các phương thức kiểm thử và các cơ chế array_helpers và stubbing module hiện có. Sau đó, điều tra collection hook của pytest và cách suite biểu diễn các hàm cấp cao nhất, các phương thức của đối tượng array và các toán tử. Phần hoàn thành cần bao gồm một biểu diễn dependency được định nghĩa, một dependency graph và cơ chế ưu tiên hoặc bỏ qua kiểm thử có xét đến dependency.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

low priority

The test suite is mostly made up of test methods for each function (or array object method) in the spec. The majority of these tests require other functions to do everything we want, which is problematic when an underlying function does not work—you'll get a lot of spammy errors that actually relate to a single fundamental problem... or even false positives.

So I think it would be a good idea if we declared the dependencies of each test method, i.e. the functions we use and assume has correct behaviour. We could use these declarations to create a dependency graph, which could be hooked with pytest to prioritise zero/low-dependency tests first, and by default skipping tests that use functions we've deemed incorrect. This will benefit:

  1. Array API adoptors, who would much more easily see what they should prioritise developing
  2. Us, who'd be able to see areas where we can try to cut down the functions we depend on

Ideas for declaring dependencies per test method:

  • Decorator which lists function and method names
  • Automatically infer dependencies via looking at function code (either searching the code as string, or using the AST)

General challenges would be:

  • How to get pytests collection hook to do this
  • Supporting array object methods alongside the top-level functions
    • As well as operator symbols

The dependency graph + auto skipping would also allow us to:

  • Remove some mirrored functions in array_helpers
  • Remove the module stubbing mechanism
  • Check that no tests is using the function they're testing for assertions
Ngôn ngữ chính
Python
Star
74
Fork
54
Merge trung bình
4 giờ 35 phút
Pull request đã merge (30 ngày)
4

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của data-apis/array-api-tests

Tất cả issue của data-apis/array-api-tests

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.