diff --git a/tests/nightly/test_large_array.py b/tests/nightly/test_large_array.py index ee57f172c1c9..1528bc02dce6 100644 --- a/tests/nightly/test_large_array.py +++ b/tests/nightly/test_large_array.py @@ -27,7 +27,7 @@ from mxnet.test_utils import rand_ndarray, assert_almost_equal, rand_coord_2d, default_context, check_symbolic_forward, create_2d_tensor from mxnet import gluon, nd -from common import with_seed, with_post_test_cleanup +from common import with_seed from nose.tools import with_setup import unittest diff --git a/tests/nightly/test_large_vector.py b/tests/nightly/test_large_vector.py index bbad75627769..70066a2a6c64 100644 --- a/tests/nightly/test_large_vector.py +++ b/tests/nightly/test_large_vector.py @@ -27,7 +27,7 @@ from mxnet.test_utils import rand_ndarray, assert_almost_equal, rand_coord_2d, create_vector from mxnet import gluon, nd -from tests.python.unittest.common import with_seed +from common import with_seed from nose.tools import with_setup import unittest diff --git a/tests/python/unittest/common.py b/tests/python/unittest/common.py index ab2d191f1360..52531021c553 100644 --- a/tests/python/unittest/common.py +++ b/tests/python/unittest/common.py @@ -310,27 +310,6 @@ def teardown(): mx.nd.waitall() -def with_post_test_cleanup(): - """ - Helper function that cleans up memory by releasing it from memory pool - Required especially by large tensor tests that have memory footprints in GBs. - """ - def test_helper(orig_test): - @make_decorator(orig_test) - def test_new(*args, **kwargs): - logger = default_logger() - try: - orig_test(*args, **kwargs) - except: - logger.info(test_msg) - raise - finally: - mx.nd.waitall() - mx.cpu().empty_cache() - return test_new - return test_helper - - def run_in_spawned_process(func, env, *args): """ Helper function to run a test in its own process. @@ -373,4 +352,4 @@ def run_in_spawned_process(func, env, *args): finally: os.environ.clear() os.environ.update(orig_environ) - return True \ No newline at end of file + return True