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

API for loop configuration options

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

Maintainer thường phản hồi trong vòng 1 ngày

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
20/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

Hướng nghiên cứu

Bắt đầu bằng cách xem xét event_loop_policy() và các fixture event_loop, các đối số của pytest.mark.asyncio, cũng như hành vi cấu hình hoặc dòng lệnh được mô tả trong issue. Issue này là một cuộc thảo luận về định hướng API trong tương lai chứ không phải một triển khai đã được xác định. Để được coi là hoàn tất, cần đạt được sự thống nhất về thiết kế cấu hình công khai và phạm vi triển khai tương ứng.

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

Mô tả

This issue doesn't propose a specific codebase change but is a point for discussing future steps in the plugin evolution.

Python has deprecated event loop policies since (unreleased) py-3.14.

The main asyncio motion idea for this and related changes is:

  1. Don't instantiate the loop explicitly, but use Runner (introduced in 3.11, there is a backport library for older Python version).
  2. Control runner behavior by debug and loop_factory arguments.
  3. There are eager tasks since 3.12; maybe the runner will have the option to configure it as well if we make an agreement

I think pytest-asyncio should reflect these changes.

  1. event_loop_policy() fixture should be deprecated along with event_loop.
  2. The library should not introduce public fixtures except unused_tcp_port and family. It is very fragile, especially if a user starts fixture overriding.
  3. Fine-grained control could be done by special pytest.mark.asyncio(...) arguments.
  4. Coarse-grained control uses configfile parameters and, maybe, cmdline args.
  5. Implementation details could vary; we are free to change them in the wild until the details are not leaked into the public space. The plugin already has a good movement in this direction, so I merely summarized what we do.

Please share your opinions in the comments, guys.

Ngôn ngữ chính
Python
Star
1.7k
Fork
207
Merge trung bình
5 giờ 2 phút
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 pytest-dev/pytest-asyncio

Tất cả issue của pytest-dev/pytest-asyncio

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.