小编cla*_*ark的帖子

使用Webstorm 8调试应用程序时,"Step Over"不起作用

我正在尝试使用WebStorm(8)调试Sails应用程序,但"Step Over"不起作用.

应用程序将在断点处停止,但当我执行"Step Over/Into/..."时,应用程序将恢复运行.我尝试了不同的断点和不同的Sails版本(0.10),仍然无法正常工作.

在此输入图像描述

调试输出:

/usr/local/bin/node --debug-brk=63616 --nolazy app.js
debugger listening on port 63616
error: Grunt :: debugger listening on port 63616

info: 
info: 
info:    Sails.js           <|
info:    v0.9.16             |\
info:                       /|.\
info:                      / || \
info:                    ,'  |'  \
info:                 .-'.-==|/_--'
info:                 `--'-------' 
info:    __---___--___---___--___---___--___
info:  ____---___--___---___--___---___--___-__
info: 
info: Server lifted in `/Developer/Projects/WebStormProjects/sailsApp`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.

debug: --------------------------------------------------------
debug: :: Mon …
Run Code Online (Sandbox Code Playgroud)

debugging webstorm sails.js

4
推荐指数
1
解决办法
1151
查看次数

使用AsyncHttpTastCase测试异步方法时,龙卷风被阻止

我是python和tornado的新手,并尝试使用@ tornado.web.asynchronous为GET方法编写单元测试.但它始终阻止并输出以下错误消息:

Failure
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 327, in run
    testMethod()
File "/Developer/PycharmProjects/CanMusic/tornadotestcase.py", line 19, in test_gen
    response = self.fetch(r'/gen')
File "/Developer/python/canmusic_env/lib/python2.7/site-packages/tornado/testing.py", line 265, in fetch
    return self.wait()
File "/Developer/python/canmusic_env/lib/python2.7/site-packages/tornado/testing.py", line 205, in wait
    self.__rethrow()
File "/Developer/python/canmusic_env/lib/python2.7/site-packages/tornado/testing.py", line 149, in __rethrow
    raise_exc_info(failure)
File "/Developer/python/canmusic_env/lib/python2.7/site-packages/tornado/testing.py", line 186, in timeout_func
    timeout)
AssertionError: Async operation timed out after 5 seconds
Run Code Online (Sandbox Code Playgroud)

我编写以下代码作为示例.将其作为单元测试(鼻子)运行,得到上面的错误.当它作为独立的应用程序运行并通过浏览器访问URL时,它工作正常.我也尝试异步的回调版本(没有@ tornado.gen.engine和yield),结果相同.

为什么?我错过了什么?

import tornado.web, tornado.gen, tornado.httpclient, tornado.testing

class GenHandler(tornado.web.RequestHandler):
    @tornado.web.asynchronous
    @tornado.gen.engine
    def get(self):
        http = tornado.httpclient.AsyncHTTPClient()
        response = …
Run Code Online (Sandbox Code Playgroud)

unit-testing asynchronous tornado

3
推荐指数
1
解决办法
2817
查看次数