Skip to content

With pytest8.2.0 or later, test cases under test/distributed/ execute will meet issue "object has no attribute 'runTest'. Did you mean: 'run_test'" #127517

Open
@hongfeng2013

Description

@hongfeng2013

🐛 Describe the bug

This information is from "docs.pytest.org"
In pytest 8.2.0: #12089: pytest now requires that unittest.TestCase subclasses can be instantiated freely using MyTestCase('runTest').

  1. With this pytest-8.2.1 version, when I execute: pytest -v test_c10d_nccl.py::NCCLTraceTest
    image

  2. With pytest-8.1.1 version, when I execute: pytest -v test_c10d_nccl.py::NCCLTraceTest
    image

The related source code, torch/testing/_internal/common_distributed.py:

def __init__(self, method_name: str = "runTest") -> None:
        super().__init__(method_name)
        fn = getattr(self, method_name)
        setattr(self, method_name, self.join_or_run(fn))

Versions

Any pytorch version

cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu @fegin @XilunWu @wanchaol @fduwjj @wz337 @tianyu-l @wconstab @yf225 @chauhang @d4l3k

Metadata

Metadata

Assignees

No one assigned

    Labels

    oncall: distributedAdd this issue/PR to distributed oncall triage queuetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions