def test():
    """Run widget test"""
    import inspect
    import tempfile
    from spyder.utils.qthelpers import qapplication

    primes_sc = inspect.getsource(primes)
    fd, script = tempfile.mkstemp(suffix='.py')
    with os.fdopen(fd, 'w') as f:
        f.write("# -*- coding: utf-8 -*-" + "\n\n")
        f.write(primes_sc + "\n\n")
        f.write("primes(100000)")
    
    app = qapplication(test_time=5)
    widget = ProfilerWidget(None)
    widget.resize(800, 600)
    widget.show()
    widget.analyze(script)
    sys.exit(app.exec_())
def test ( ) : import inspect import tempfile from spyder . utils . qthelpers import qapplication primes_sc = inspect . getsource ( primes ) fd , script = tempfile . mkstemp ( suffix = '.py' ) with os . fdopen ( fd , 'w' ) as f : f . write ( "# -*- coding: utf-8 -*-" + "\n\n" ) f . write ( primes_sc + "\n\n" ) f . write ( "primes(100000)" ) app = qapplication ( test_time = 5 ) widget = ProfilerWidget ( None ) widget . resize ( 800 , 600 ) widget . show ( ) widget . analyze ( script ) sys . exit ( app . exec_ ( ) )
Run widget test