pytest
pytest copied to clipboard
PyTest 8.2.0 in compatible with certain versions of pytorch, especially DDP tests
_ ERROR collecting test/distributed/_composable/fsdp/test_fully_shard_comm.py __ Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/_pytest/runner.py", line 341, in from_call result: Optional[TResult] = func() File "/usr/local/lib/python3.10/dist-packages/_pytest/runner.py", line 389, in collect return list(collector.collect()) File "/usr/local/lib/python3.10/dist-packages/_pytest/unittest.py", line 90, in collect self.session._fixturemanager.parsefactories(self.newinstance(), self.nodeid) File "/usr/local/lib/python3.10/dist-packages/_pytest/unittest.py", line 75, in newinstance return self.obj("runTest") File "/usr/local/lib/python3.10/dist-packages/torch/testing/_internal/common_distributed.py", line 553, in init fn = getattr(self, method_name) AttributeError: 'FSDPTest' object has no attribute 'runTest'. Did you mean: 'run_test'?
We encountered this error with pytest 8.2.0. Not sure if latest pytorch TOT fixed this issue.
Looks like a similar problem to #12263, as seen here: https://github.com/pytorch/pytorch/blob/f1d1e3246f3203a4c9641fcda28b0ed66eb8f4d4/torch/testing/_internal/common_distributed.py#L547
The fix in pytorch would be similar to the one shown here for tornado: https://github.com/tornadoweb/tornado/pull/3374
I'm closing this as per the (retro-added) breaking change note here: https://docs.pytest.org/en/stable/changelog.html#breaking-changes