Skip to content

Commit

Permalink
Remove init due to breaking change in pytest 8.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tibor-reiss committed Oct 22, 2024
1 parent c9b5996 commit 1a74714
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions mmengine/testing/_internal/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,15 @@ def wrapper(self):

return types.MethodType(wrapper, self)

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

def setUp(self) -> None:
super().setUp()
self.skip_return_code_checks = [] # type: ignore[var-annotated]
self.processes = [] # type: ignore[var-annotated]
Expand Down

0 comments on commit 1a74714

Please sign in to comment.