Skip to content

Commit 1a74714

Browse files
committed
Remove init due to breaking change in pytest 8.2.0
1 parent c9b5996 commit 1a74714

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

mmengine/testing/_internal/distributed.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,15 @@ def wrapper(self):
8888

8989
return types.MethodType(wrapper, self)
9090

91-
# The main process spawns N subprocesses that run the test.
92-
# Constructor patches current instance test method to
93-
# assume the role of the main process and join its subprocesses,
94-
# or run the underlying test function.
95-
def __init__(self, method_name: str = 'runTest') -> None:
96-
super().__init__(method_name)
91+
def setUp(self) -> None:
92+
# The main process spawns N subprocesses that run the test.
93+
# This patches current instance test method to
94+
# assume the role of the main process and join its subprocesses,
95+
# or run the underlying test function.
96+
method_name = self._testMethodName
9797
fn = getattr(self, method_name)
9898
setattr(self, method_name, self.join_or_run(fn))
9999

100-
def setUp(self) -> None:
101100
super().setUp()
102101
self.skip_return_code_checks = [] # type: ignore[var-annotated]
103102
self.processes = [] # type: ignore[var-annotated]

0 commit comments

Comments
 (0)