【问题标题】:How to apply Indentation for Robot Framework code using pycharm如何使用 pycharm 为 Robot Framework 代码应用缩进
【发布时间】:2020-01-20 06:37:50
【问题描述】:

我正在使用带有 Pycharm IDE 的 Robot Framework 进行数据库数据验证。当我使用带有 Raw sql 的任何执行查询时,查询会超出缩进行。如何打破长查询并适合 pycharm 缩进行。

前:

  ${client}=  DB2.query  SELECT COUNT(DISTINCT host.id) FROM a.host,a.Host host WHERE host.client_id = host.client_id AND host.host_id = host.id AND host.client_id = ${client_id} AND host.status = 'OPEN';

请也找到下面附加的屏幕截图。 我想要

host.host_id = host.id AND host.client_id = ${client_id} AND host.status = 'OPEN';

移到下一行。 我尝试使用“\”或“/”但不起作用。

【问题讨论】:

    标签: python pycharm robotframework


    【解决方案1】:

    您可以使用 Robot Framework 内置变量 ${\n} 在任意位置添加换行符。

    例如:

     ${client}=  DB2.query  SELECT COUNT(DISTINCT host.id) FROM a.host,a.Host host WHERE host.client_id = host.client_id AND ${\n} host.host_id = host.id AND host.client_id = ${client_id} AND host.status = 'OPEN';
    

    【讨论】:

      猜你喜欢
      • 2018-05-21
      • 2015-01-31
      • 2017-10-06
      • 2021-01-19
      • 2022-07-19
      • 2022-08-20
      • 2014-07-24
      • 2021-12-12
      • 2015-08-12
      相关资源
      最近更新 更多