"vscode:/vscode.git/clone" did not exist on "9d42e9fae10a0b6d9110c48423e7c5017310a499"
Commit 004be54f authored by Yanghan Wang's avatar Yanghan Wang Committed by Facebook GitHub Bot
Browse files

remove unused functions in default_runner

Summary: No usage: https://www.internalfb.com/code/search?q=filepath%3Ad2go%2F%20repo%3Afbcode%20_mock_func

Differential Revision: D31591868

fbshipit-source-id: 3fc6103c40713fa7bf278fd57a3e8fb4436a0902
parent 3b23dd39
......@@ -2,7 +2,6 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import contextlib
import logging
import math
import os
......@@ -12,7 +11,6 @@ from typing import Type, Optional, List
import d2go.utils.abnormal_checker as abnormal_checker
import detectron2.utils.comm as comm
import mock
import torch
from d2go.config import (
CfgNode,
......@@ -74,16 +72,6 @@ from mobile_cv.predictor.api import PredictorWrapper
logger = logging.getLogger(__name__)
@contextlib.contextmanager
def _mock_func(module, src_func, target_func):
with mock.patch(
"{}.{}".format(module.__name__, src_func.__name__), side_effect=target_func
) as mocked_func:
yield
if not mocked_func.call_count >= 1:
logger.warning("Didn't patch the {} in module {}".format(src_func, module))
ALL_TB_WRITERS = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment