pylint - 是否有教程如何抑制 Squish 的 Pylint 警告?
问题描述
我试图抑制来自 Squish 的 Pylint 警告,但没有在代码前面编写相同的代码,如下所述:https ://kb.froglogic.com/display/KB/Example+-+Using+PyLint+with+Squish +test+scripts+that+use+source%28%29
我想知道是否是我可以配置并上传到 Squish 的文件
解决方案
本文描述了唯一的选择,即自己定义 Squish 函数和符号。
但是,为了简单起见,它仅显示了在单个文件 Squish 测试脚本文件中执行的操作。
您当然应该将这些 Squish 函数定义放在一个单独的、可重用的文件中,并使用 import 将定义“加载”到您的 test.py 文件中:
from squish_definitions import *
def main():
...
在 squish_definitions.py 中:
# Trick Pylint and Python IDEs into accepting the
# definitions in this block, whereas upon execution
# none of these definitions will take place:
if -0:
class ApplicationContext:
pass
def startApplication(aut_path_or_name, optional_squishserver_host, optional_squishserver_port):
return ApplicationContext
# etc.
此外,您通常应该切换到使用 Python 的导入来支持 Squish 的 source() 函数。
推荐阅读
- javascript - 我的敌人一直在随机拼接,我不知道为什么?
- javascript - 如何在 node.js 中从 MySQL 访问变量?
- regex - htacess URL 重写器在我的主机上不起作用
- reactjs - Gatsby:使用 localStorage 存储数据
- erlang - 强制转换为 `any()` 是让 Dialyzer 接受 ETS 匹配模式的好解决方案吗?
- c++ - 是否可以使用定制的 GUI 来操作另一个程序的文本文件上的信息?如果是这样,怎么做?
- web - Microsoft IIS 虚拟目录:在本地服务器上托管图像,在本地网站上显示
- android - 如何在flutter中创建自定义BottomNavigationBar?
- api - 版本一 - 获取与项目关联的所有团队和成员
- 3d - 如何让 3D 相机并排“跟随”角色位置