You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/09/04 06:14:35 UTC

[GitHub] [incubator-mxnet] apeforest commented on a change in pull request #16088: remove 'foo' and other print msg from test

apeforest commented on a change in pull request #16088: remove 'foo' and other print msg from test
URL: https://github.com/apache/incubator-mxnet/pull/16088#discussion_r320587164
 
 

 ##########
 File path: tests/python/unittest/test_profiler.py
 ##########
 @@ -152,23 +151,24 @@ def makeParams():
         template = ''.join('{%d}' % i for i in range(len(objects)))
         return template, objects
 
-    def doLog():
+    def get_log():
         template, objects = makeParams()
+        logs = []
         for _ in range(100000):
-            logging.info(template.format(*objects))
+            logs.append(template.format(*objects))
+        return logs
 
-    logging.basicConfig()
     if do_enable_profiler is True:
         enable_profiler('test_profile_event.json')
     event = profiler.Event("test_profile_event")
     event.start()
     start = time.time()
     var = mx.nd.ones((1000, 500))
-    doLog()
+    assert len(get_log()) == 100000
     var.asnumpy()
     stop = time.time()
     event.stop()
-    print('run took: %.3f' % (stop - start))
 
 Review comment:
   yes, there should be no print in unit test

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services