robotframework 6.1rc1__zip → 7.0a1__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. {robotframework-6.1rc1/src/robotframework.egg-info → robotframework-7.0a1}/PKG-INFO +3 -6
  2. {robotframework-6.1rc1 → robotframework-7.0a1}/setup.py +2 -5
  3. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/api/interfaces.py +36 -49
  4. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/api/parsing.py +4 -2
  5. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/conf/gatherfailed.py +2 -2
  6. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/conf/languages.py +61 -25
  7. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/conf/settings.py +8 -5
  8. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/log.css +4 -0
  9. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/log.html +9 -1
  10. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/model.js +2 -4
  11. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/testdata.js +10 -3
  12. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/template.py +3 -3
  13. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/builder.py +0 -8
  14. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/datatypes.py +9 -10
  15. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/htmlutils.py +4 -7
  16. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/jsonbuilder.py +14 -10
  17. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/model.py +13 -25
  18. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/robotbuilder.py +14 -4
  19. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/xmlbuilder.py +8 -8
  20. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/xmlwriter.py +12 -38
  21. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/BuiltIn.py +215 -189
  22. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/Collections.py +2 -9
  23. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/DateTime.py +1 -1
  24. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/OperatingSystem.py +4 -3
  25. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/Process.py +26 -27
  26. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/Remote.py +40 -36
  27. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/String.py +4 -4
  28. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/XML.py +7 -8
  29. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/__init__.py +2 -2
  30. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/dialogs_py.py +14 -2
  31. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/__init__.py +4 -4
  32. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/body.py +14 -6
  33. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/configurer.py +19 -15
  34. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/control.py +155 -85
  35. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/filter.py +31 -25
  36. robotframework-7.0a1/src/robot/model/keyword.py +70 -0
  37. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/message.py +19 -10
  38. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/modelobject.py +2 -8
  39. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/modifier.py +1 -1
  40. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/namepatterns.py +3 -25
  41. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/stats.py +9 -15
  42. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/tags.py +1 -1
  43. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/testcase.py +12 -21
  44. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/testsuite.py +43 -24
  45. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/visitor.py +35 -8
  46. robotframework-7.0a1/src/robot/output/console/dotted.py +90 -0
  47. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/console/quiet.py +3 -2
  48. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/console/verbose.py +60 -60
  49. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/debugfile.py +36 -23
  50. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/filelogger.py +16 -13
  51. robotframework-7.0a1/src/robot/output/listeners.py +586 -0
  52. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/logger.py +164 -77
  53. robotframework-7.0a1/src/robot/output/loggerapi.py +152 -0
  54. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/loggerhelper.py +23 -56
  55. robotframework-7.0a1/src/robot/output/output.py +158 -0
  56. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/stdoutlogsplitter.py +8 -5
  57. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/xmllogger.py +163 -109
  58. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/lexer/blocklexers.py +17 -13
  59. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/lexer/context.py +12 -2
  60. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/lexer/lexer.py +1 -1
  61. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/lexer/settings.py +6 -3
  62. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/lexer/statementlexers.py +39 -10
  63. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/lexer/tokens.py +27 -29
  64. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/model/blocks.py +19 -6
  65. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/model/statements.py +184 -84
  66. robotframework-7.0a1/src/robot/parsing/model/visitor.py +102 -0
  67. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/reporting/expandkeywordmatcher.py +1 -1
  68. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/reporting/jsbuildingcontext.py +8 -6
  69. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/reporting/jsmodelbuilders.py +88 -61
  70. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/reporting/stringcache.py +4 -3
  71. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/reporting/xunitwriter.py +15 -21
  72. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/__init__.py +3 -2
  73. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/configurer.py +12 -9
  74. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/flattenkeywordmatcher.py +8 -8
  75. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/keywordremover.py +71 -54
  76. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/merger.py +1 -1
  77. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/model.py +400 -316
  78. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/modeldeprecation.py +9 -3
  79. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/resultbuilder.py +21 -23
  80. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/xmlelementhandlers.py +76 -40
  81. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/run.py +1 -1
  82. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/__init__.py +1 -1
  83. robotframework-7.0a1/src/robot/running/arguments/argumentconverter.py +101 -0
  84. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/arguments/argumentmapper.py +16 -14
  85. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/arguments/argumentparser.py +3 -1
  86. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/arguments/argumentresolver.py +41 -33
  87. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/arguments/argumentspec.py +24 -90
  88. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/arguments/argumentvalidator.py +34 -27
  89. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/arguments/customconverters.py +14 -11
  90. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/arguments/embedded.py +23 -26
  91. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/arguments/typeconverters.py +210 -220
  92. robotframework-7.0a1/src/robot/running/arguments/typeinfo.py +367 -0
  93. robotframework-7.0a1/src/robot/running/arguments/typevalidator.py +62 -0
  94. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/bodyrunner.py +83 -68
  95. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/builder/builders.py +15 -25
  96. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/builder/parsers.py +15 -10
  97. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/builder/settings.py +9 -17
  98. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/builder/transformers.py +166 -308
  99. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/context.py +80 -25
  100. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/handlers.py +11 -16
  101. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/handlerstore.py +1 -1
  102. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/librarykeywordrunner.py +9 -17
  103. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/model.py +156 -36
  104. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/namespace.py +18 -19
  105. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/statusreporter.py +13 -12
  106. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/suiterunner.py +18 -21
  107. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/testlibraries.py +35 -39
  108. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/usererrorhandler.py +8 -8
  109. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/userkeyword.py +13 -8
  110. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/userkeywordrunner.py +18 -21
  111. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/testdoc.py +18 -13
  112. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/__init__.py +50 -35
  113. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/connectioncache.py +64 -59
  114. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/encodingsniffer.py +9 -4
  115. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/escaping.py +11 -9
  116. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/markupwriters.py +20 -13
  117. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/normalizing.py +9 -24
  118. robotframework-7.0a1/src/robot/utils/notset.py +33 -0
  119. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/platform.py +15 -5
  120. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/robotpath.py +1 -0
  121. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/robottime.py +120 -88
  122. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/robottypes.py +16 -31
  123. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/setter.py +0 -5
  124. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/text.py +7 -4
  125. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/unic.py +2 -2
  126. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/__init__.py +2 -2
  127. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/assigner.py +17 -19
  128. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/evaluation.py +20 -17
  129. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/filesetter.py +80 -80
  130. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/replacer.py +33 -36
  131. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/scopes.py +3 -3
  132. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/search.py +66 -41
  133. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/store.py +14 -16
  134. robotframework-7.0a1/src/robot/variables/tablesetter.py +164 -0
  135. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/variables.py +1 -1
  136. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/version.py +1 -1
  137. {robotframework-6.1rc1 → robotframework-7.0a1/src/robotframework.egg-info}/PKG-INFO +3 -6
  138. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robotframework.egg-info/SOURCES.txt +3 -4
  139. {robotframework-6.1rc1 → robotframework-7.0a1}/tasks.py +6 -6
  140. robotframework-6.1rc1/src/robot/libraries/Reserved.py +0 -48
  141. robotframework-6.1rc1/src/robot/model/keyword.py +0 -173
  142. robotframework-6.1rc1/src/robot/output/console/dotted.py +0 -90
  143. robotframework-6.1rc1/src/robot/output/listenerarguments.py +0 -165
  144. robotframework-6.1rc1/src/robot/output/listenermethods.py +0 -113
  145. robotframework-6.1rc1/src/robot/output/listeners.py +0 -174
  146. robotframework-6.1rc1/src/robot/output/output.py +0 -95
  147. robotframework-6.1rc1/src/robot/parsing/model/visitor.py +0 -67
  148. robotframework-6.1rc1/src/robot/running/arguments/argumentconverter.py +0 -79
  149. robotframework-6.1rc1/src/robot/running/arguments/typevalidator.py +0 -56
  150. robotframework-6.1rc1/src/robot/running/modelcombiner.py +0 -32
  151. robotframework-6.1rc1/src/robot/variables/tablesetter.py +0 -156
  152. {robotframework-6.1rc1 → robotframework-7.0a1}/AUTHORS.rst +0 -0
  153. {robotframework-6.1rc1 → robotframework-7.0a1}/BUILD.rst +0 -0
  154. {robotframework-6.1rc1 → robotframework-7.0a1}/CONTRIBUTING.rst +0 -0
  155. {robotframework-6.1rc1 → robotframework-7.0a1}/COPYRIGHT.txt +0 -0
  156. {robotframework-6.1rc1 → robotframework-7.0a1}/INSTALL.rst +0 -0
  157. {robotframework-6.1rc1 → robotframework-7.0a1}/LICENSE.txt +0 -0
  158. {robotframework-6.1rc1 → robotframework-7.0a1}/MANIFEST.in +0 -0
  159. {robotframework-6.1rc1 → robotframework-7.0a1}/README.rst +0 -0
  160. {robotframework-6.1rc1 → robotframework-7.0a1}/setup.cfg +0 -0
  161. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/__init__.py +0 -0
  162. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/__main__.py +0 -0
  163. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/api/__init__.py +0 -0
  164. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/api/deco.py +0 -0
  165. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/api/exceptions.py +0 -0
  166. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/api/logger.py +0 -0
  167. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/conf/__init__.py +0 -0
  168. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/errors.py +0 -0
  169. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/__init__.py +0 -0
  170. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/common/__init__.py +0 -0
  171. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/common/js_disabled.css +0 -0
  172. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/common/storage.js +0 -0
  173. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/htmlfilewriter.py +0 -0
  174. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/jsonwriter.py +0 -0
  175. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/lib/__init__.py +0 -0
  176. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/lib/jquery.highlight.min.js +0 -0
  177. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/lib/jquery.min.js +0 -0
  178. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/lib/jquery.tablesorter.min.js +0 -0
  179. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/lib/jquery.tmpl.min.js +0 -0
  180. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/lib/jsxcompressor.min.js +0 -0
  181. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/__init__.py +0 -0
  182. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/doc_formatting.css +0 -0
  183. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/libdoc.css +0 -0
  184. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/libdoc.html +0 -0
  185. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/print.css +0 -0
  186. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/libdoc/pygments.css +0 -0
  187. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/__init__.py +0 -0
  188. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/common.css +0 -0
  189. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/doc_formatting.css +0 -0
  190. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/fileloading.js +0 -0
  191. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/log.js +0 -0
  192. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/print.css +0 -0
  193. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/report.css +0 -0
  194. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/report.html +0 -0
  195. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/util.js +0 -0
  196. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/rebot/view.js +0 -0
  197. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/testdoc/__init__.py +0 -0
  198. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/testdoc/testdoc.css +0 -0
  199. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/htmldata/testdoc/testdoc.html +0 -0
  200. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdoc.py +0 -0
  201. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/__init__.py +0 -0
  202. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/consoleviewer.py +0 -0
  203. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/htmlwriter.py +0 -0
  204. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/jsonwriter.py +0 -0
  205. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/output.py +0 -0
  206. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/standardtypes.py +0 -0
  207. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libdocpkg/writer.py +0 -0
  208. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/Dialogs.py +0 -0
  209. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/Easter.py +0 -0
  210. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/Screenshot.py +0 -0
  211. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/libraries/Telnet.py +0 -0
  212. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/fixture.py +0 -0
  213. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/itemlist.py +0 -0
  214. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/metadata.py +0 -0
  215. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/statistics.py +0 -0
  216. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/suitestatistics.py +0 -0
  217. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/tagsetter.py +0 -0
  218. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/tagstatistics.py +0 -0
  219. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/model/totalstatistics.py +0 -0
  220. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/__init__.py +0 -0
  221. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/console/__init__.py +0 -0
  222. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/console/highlighting.py +0 -0
  223. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/librarylogger.py +0 -0
  224. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/output/pyloggingconf.py +0 -0
  225. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/__init__.py +0 -0
  226. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/lexer/__init__.py +0 -0
  227. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/lexer/tokenizer.py +0 -0
  228. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/model/__init__.py +0 -0
  229. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/parser/__init__.py +0 -0
  230. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/parser/blockparsers.py +0 -0
  231. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/parser/fileparser.py +0 -0
  232. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/parser/parser.py +0 -0
  233. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/parsing/suitestructure.py +0 -0
  234. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/pythonpathsetter.py +0 -0
  235. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/rebot.py +0 -0
  236. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/reporting/__init__.py +0 -0
  237. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/reporting/jsexecutionresult.py +0 -0
  238. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/reporting/jswriter.py +0 -0
  239. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/reporting/logreportwriters.py +0 -0
  240. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/reporting/outputwriter.py +0 -0
  241. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/reporting/resultwriter.py +0 -0
  242. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/executionerrors.py +0 -0
  243. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/executionresult.py +0 -0
  244. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/messagefilter.py +0 -0
  245. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/suiteteardownfailed.py +0 -0
  246. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/result/visitor.py +0 -0
  247. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/arguments/__init__.py +0 -0
  248. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/builder/__init__.py +0 -0
  249. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/dynamicmethods.py +0 -0
  250. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/importer.py +0 -0
  251. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/libraryscopes.py +0 -0
  252. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/outputcapture.py +0 -0
  253. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/randomizer.py +0 -0
  254. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/runkwregister.py +0 -0
  255. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/signalhandler.py +0 -0
  256. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/status.py +0 -0
  257. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/timeouts/__init__.py +0 -0
  258. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/timeouts/posix.py +0 -0
  259. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/running/timeouts/windows.py +0 -0
  260. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/application.py +0 -0
  261. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/argumentparser.py +0 -0
  262. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/asserts.py +0 -0
  263. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/charwidth.py +0 -0
  264. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/compress.py +0 -0
  265. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/dotdict.py +0 -0
  266. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/encoding.py +0 -0
  267. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/error.py +0 -0
  268. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/etreewrapper.py +0 -0
  269. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/filereader.py +0 -0
  270. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/frange.py +0 -0
  271. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/htmlformatters.py +0 -0
  272. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/importer.py +0 -0
  273. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/markuputils.py +0 -0
  274. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/match.py +0 -0
  275. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/misc.py +0 -0
  276. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/recommendations.py +0 -0
  277. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/restreader.py +0 -0
  278. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/robotenv.py +0 -0
  279. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/robotinspect.py +0 -0
  280. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/robotio.py +0 -0
  281. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/sortable.py +0 -0
  282. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/utils/typehints.py +0 -0
  283. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/finders.py +0 -0
  284. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/notfound.py +0 -0
  285. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robot/variables/resolvable.py +0 -0
  286. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robotframework.egg-info/dependency_links.txt +0 -0
  287. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robotframework.egg-info/entry_points.txt +0 -0
  288. {robotframework-6.1rc1 → robotframework-7.0a1}/src/robotframework.egg-info/top_level.txt +0 -0
@@ -59,29 +59,33 @@ class SuiteConfigurer(SuiteVisitor):
59
59
  name = suite.name
60
60
  suite.filter(self.include_suites, self.include_tests,
61
61
  self.include_tags, self.exclude_tags)
62
- if not (suite.test_count or self.empty_suite_ok):
63
- self._raise_no_tests_error(name, suite.rpa)
62
+ if not (suite.has_tests or self.empty_suite_ok):
63
+ self._raise_no_tests_or_tasks_error(name, suite.rpa)
64
64
 
65
- def _raise_no_tests_error(self, suite, rpa=False):
66
- parts = ['tests' if not rpa else 'tasks',
65
+ def _raise_no_tests_or_tasks_error(self, name, rpa):
66
+ parts = [{False: 'tests', True: 'tasks', None: 'tests or tasks'}[rpa],
67
67
  self._get_test_selector_msgs(),
68
68
  self._get_suite_selector_msg()]
69
- raise DataError("Suite '%s' contains no %s."
70
- % (suite, ' '.join(p for p in parts if p)))
69
+ raise DataError(f"Suite '{name}' contains no "
70
+ f"{' '.join(p for p in parts if p)}.")
71
71
 
72
72
  def _get_test_selector_msgs(self):
73
73
  parts = []
74
- for explanation, selector in [('matching tags', self.include_tags),
75
- ('not matching tags', self.exclude_tags),
76
- ('matching name', self.include_tests)]:
77
- if selector:
78
- parts.append(self._format_selector_msg(explanation, selector))
79
- return seq2str(parts, quote='')
74
+ for separator, explanation, selectors in [
75
+ (None, 'matching name', self.include_tests),
76
+ ('or', 'matching tags', self.include_tags),
77
+ ('and', 'not matching tags', self.exclude_tags)
78
+ ]:
79
+ if selectors:
80
+ if parts:
81
+ parts.append(separator)
82
+ parts.append(self._format_selector_msg(explanation, selectors))
83
+ return ' '.join(parts)
80
84
 
81
- def _format_selector_msg(self, explanation, selector):
82
- if len(selector) == 1 and explanation[-1] == 's':
85
+ def _format_selector_msg(self, explanation, selectors):
86
+ if len(selectors) == 1 and explanation[-1] == 's':
83
87
  explanation = explanation[:-1]
84
- return '%s %s' % (explanation, seq2str(selector, lastsep=' or '))
88
+ return f"{explanation} {seq2str(selectors, lastsep=' or ')}"
85
89
 
86
90
  def _get_suite_selector_msg(self):
87
91
  if not self.include_suites:
@@ -13,15 +13,12 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- import sys
17
- from typing import Any, cast, Sequence, TypeVar, TYPE_CHECKING
18
- if sys.version_info >= (3, 8):
19
- from typing import Literal
16
+ import warnings
17
+ from typing import Any, cast, Literal, Sequence, TypeVar, TYPE_CHECKING
20
18
 
21
19
  from robot.utils import setter
22
20
 
23
21
  from .body import Body, BodyItem, BodyItemParent, BaseBranches
24
- from .keyword import Keywords
25
22
  from .modelobject import DataDict
26
23
  from .visitor import SuiteVisitor
27
24
 
@@ -31,31 +28,27 @@ if TYPE_CHECKING:
31
28
  IT = TypeVar('IT', bound='IfBranch|TryBranch')
32
29
 
33
30
 
34
- class Branches(BaseBranches['Keyword', 'For', 'While', 'If', 'Try', 'Return', 'Continue',
35
- 'Break', 'Message', 'Error', IT]):
31
+ class Branches(BaseBranches['Keyword', 'For', 'While', 'If', 'Try', 'Var', 'Return',
32
+ 'Continue', 'Break', 'Message', 'Error', IT]):
36
33
  pass
37
34
 
38
35
 
39
36
  @Body.register
40
37
  class For(BodyItem):
41
- """Represents ``FOR`` loops.
42
-
43
- :attr:`flavor` specifies the flavor, and it can be ``IN``, ``IN RANGE``,
44
- ``IN ENUMERATE`` or ``IN ZIP``.
45
- """
38
+ """Represents ``FOR`` loops."""
46
39
  type = BodyItem.FOR
47
40
  body_class = Body
48
- repr_args = ('variables', 'flavor', 'values', 'start', 'mode', 'fill')
49
- __slots__ = ['variables', 'flavor', 'values', 'start', 'mode', 'fill']
41
+ repr_args = ('assign', 'flavor', 'values', 'start', 'mode', 'fill')
42
+ __slots__ = ['assign', 'flavor', 'values', 'start', 'mode', 'fill']
50
43
 
51
- def __init__(self, variables: Sequence[str] = (),
52
- flavor: "Literal['IN', 'IN RANGE', 'IN ENUMERATE', 'IN ZIP']" = 'IN',
44
+ def __init__(self, assign: Sequence[str] = (),
45
+ flavor: Literal['IN', 'IN RANGE', 'IN ENUMERATE', 'IN ZIP'] = 'IN',
53
46
  values: Sequence[str] = (),
54
47
  start: 'str|None' = None,
55
48
  mode: 'str|None' = None,
56
49
  fill: 'str|None' = None,
57
50
  parent: BodyItemParent = None):
58
- self.variables = tuple(variables)
51
+ self.assign = tuple(assign)
59
52
  self.flavor = flavor
60
53
  self.values = tuple(values)
61
54
  self.start = start
@@ -64,37 +57,29 @@ class For(BodyItem):
64
57
  self.parent = parent
65
58
  self.body = ()
66
59
 
60
+ @property
61
+ def variables(self) -> 'tuple[str, ...]': # TODO: Remove in RF 8.0.
62
+ """Deprecated since Robot Framework 7.0. Use :attr:`assign` instead."""
63
+ warnings.warn("'For.variables' is deprecated and will be removed in "
64
+ "Robot Framework 8.0. Use 'For.assign' instead.")
65
+ return self.assign
66
+
67
+ @variables.setter
68
+ def variables(self, assign: 'tuple[str, ...]'):
69
+ warnings.warn("'For.variables' is deprecated and will be removed in "
70
+ "Robot Framework 8.0. Use 'For.assign' instead.")
71
+ self.assign = assign
72
+
67
73
  @setter
68
74
  def body(self, body: 'Sequence[BodyItem|DataDict]') -> Body:
69
75
  return self.body_class(self, body)
70
76
 
71
- @property
72
- def keywords(self):
73
- """Deprecated since Robot Framework 4.0. Use :attr:`body` instead."""
74
- return Keywords(self, self.body)
75
-
76
- @keywords.setter
77
- def keywords(self, keywords):
78
- Keywords.raise_deprecation_error()
79
-
80
77
  def visit(self, visitor: SuiteVisitor):
81
78
  visitor.visit_for(self)
82
79
 
83
- def __str__(self):
84
- parts = ['FOR', *self.variables, self.flavor, *self.values]
85
- for name, value in [('start', self.start),
86
- ('mode', self.mode),
87
- ('fill', self.fill)]:
88
- if value is not None:
89
- parts.append(f'{name}={value}')
90
- return ' '.join(parts)
91
-
92
- def _include_in_repr(self, name: str, value: Any) -> bool:
93
- return name not in ('start', 'mode', 'fill') or value is not None
94
-
95
80
  def to_dict(self) -> DataDict:
96
81
  data = {'type': self.type,
97
- 'variables': self.variables,
82
+ 'assign': self.assign,
98
83
  'flavor': self.flavor,
99
84
  'values': self.values}
100
85
  for name, value in [('start', self.start),
@@ -105,6 +90,18 @@ class For(BodyItem):
105
90
  data['body'] = self.body.to_dicts()
106
91
  return data
107
92
 
93
+ def __str__(self):
94
+ parts = ['FOR', *self.assign, self.flavor, *self.values]
95
+ for name, value in [('start', self.start),
96
+ ('mode', self.mode),
97
+ ('fill', self.fill)]:
98
+ if value is not None:
99
+ parts.append(f'{name}={value}')
100
+ return ' '.join(parts)
101
+
102
+ def _include_in_repr(self, name: str, value: Any) -> bool:
103
+ return value is not None or name in ('assign', 'flavor', 'values')
104
+
108
105
 
109
106
  @Body.register
110
107
  class While(BodyItem):
@@ -133,18 +130,6 @@ class While(BodyItem):
133
130
  def visit(self, visitor: SuiteVisitor):
134
131
  visitor.visit_while(self)
135
132
 
136
- def __str__(self) -> str:
137
- parts = ['WHILE']
138
- if self.condition is not None:
139
- parts.append(self.condition)
140
- if self.limit is not None:
141
- parts.append(f'limit={self.limit}')
142
- if self.on_limit is not None:
143
- parts.append(f'limit={self.on_limit}')
144
- if self.on_limit_message is not None:
145
- parts.append(f'on_limit_message={self.on_limit_message}')
146
- return ' '.join(parts)
147
-
148
133
  def _include_in_repr(self, name: str, value: Any) -> bool:
149
134
  return name == 'condition' or value is not None
150
135
 
@@ -152,12 +137,25 @@ class While(BodyItem):
152
137
  data: DataDict = {'type': self.type}
153
138
  for name, value in [('condition', self.condition),
154
139
  ('limit', self.limit),
140
+ ('on_limit', self.on_limit),
155
141
  ('on_limit_message', self.on_limit_message)]:
156
142
  if value is not None:
157
143
  data[name] = value
158
144
  data['body'] = self.body.to_dicts()
159
145
  return data
160
146
 
147
+ def __str__(self) -> str:
148
+ parts = ['WHILE']
149
+ if self.condition is not None:
150
+ parts.append(self.condition)
151
+ if self.limit is not None:
152
+ parts.append(f'limit={self.limit}')
153
+ if self.on_limit is not None:
154
+ parts.append(f'on_limit={self.on_limit}')
155
+ if self.on_limit_message is not None:
156
+ parts.append(f'on_limit_message={self.on_limit_message}')
157
+ return ' '.join(parts)
158
+
161
159
 
162
160
  class IfBranch(BodyItem):
163
161
  """Represents individual ``IF``, ``ELSE IF`` or ``ELSE`` branch."""
@@ -186,6 +184,16 @@ class IfBranch(BodyItem):
186
184
  return self._get_id(self.parent)
187
185
  return self._get_id(self.parent.parent)
188
186
 
187
+ def visit(self, visitor: SuiteVisitor):
188
+ visitor.visit_if_branch(self)
189
+
190
+ def to_dict(self) -> DataDict:
191
+ data = {'type': self.type}
192
+ if self.condition:
193
+ data['condition'] = self.condition
194
+ data['body'] = self.body.to_dicts()
195
+ return data
196
+
189
197
  def __str__(self) -> str:
190
198
  if self.type == self.IF:
191
199
  return f'IF {self.condition}'
@@ -193,17 +201,6 @@ class IfBranch(BodyItem):
193
201
  return f'ELSE IF {self.condition}'
194
202
  return 'ELSE'
195
203
 
196
- def visit(self, visitor: SuiteVisitor):
197
- visitor.visit_if_branch(self)
198
-
199
- def to_dict(self) -> DataDict:
200
- data = {'type': self.type,
201
- 'condition': self.condition,
202
- 'body': self.body.to_dicts()}
203
- if self.type == self.ELSE:
204
- data.pop('condition')
205
- return data
206
-
207
204
 
208
205
  @Body.register
209
206
  class If(BodyItem):
@@ -237,23 +234,36 @@ class If(BodyItem):
237
234
  class TryBranch(BodyItem):
238
235
  """Represents individual ``TRY``, ``EXCEPT``, ``ELSE`` or ``FINALLY`` branch."""
239
236
  body_class = Body
240
- repr_args = ('type', 'patterns', 'pattern_type', 'variable')
241
- __slots__ = ['type', 'patterns', 'pattern_type', 'variable']
237
+ repr_args = ('type', 'patterns', 'pattern_type', 'assign')
238
+ __slots__ = ['type', 'patterns', 'pattern_type', 'assign']
242
239
 
243
240
  def __init__(self, type: str = BodyItem.TRY,
244
241
  patterns: Sequence[str] = (),
245
242
  pattern_type: 'str|None' = None,
246
- variable: 'str|None' = None,
243
+ assign: 'str|None' = None,
247
244
  parent: BodyItemParent = None):
248
- if (patterns or pattern_type or variable) and type != BodyItem.EXCEPT:
249
- raise TypeError(f"'{type}' branches do not accept patterns or variables.")
245
+ if (patterns or pattern_type or assign) and type != BodyItem.EXCEPT:
246
+ raise TypeError(f"'{type}' branches do not accept patterns or assignment.")
250
247
  self.type = type
251
248
  self.patterns = tuple(patterns)
252
249
  self.pattern_type = pattern_type
253
- self.variable = variable
250
+ self.assign = assign
254
251
  self.parent = parent
255
252
  self.body = ()
256
253
 
254
+ @property
255
+ def variable(self) -> 'str|None': # TODO: Remove in RF 8.0.
256
+ """Deprecated since Robot Framework 7.0. Use :attr:`assign` instead."""
257
+ warnings.warn("'TryBranch.variable' is deprecated and will be removed in "
258
+ "Robot Framework 8.0. Use 'TryBranch.assign' instead.")
259
+ return self.assign
260
+
261
+ @variable.setter
262
+ def variable(self, assign: 'str|None'):
263
+ warnings.warn("'TryBranch.variable' is deprecated and will be removed in "
264
+ "Robot Framework 8.0. Use 'TryBranch.assign' instead.")
265
+ self.assign = assign
266
+
257
267
  @setter
258
268
  def body(self, body: 'Sequence[BodyItem|DataDict]') -> Body:
259
269
  return self.body_class(self, body)
@@ -267,19 +277,6 @@ class TryBranch(BodyItem):
267
277
  return self._get_id(self.parent)
268
278
  return self._get_id(self.parent.parent)
269
279
 
270
- def __str__(self) -> str:
271
- if self.type != BodyItem.EXCEPT:
272
- return self.type
273
- parts = ['EXCEPT', *self.patterns]
274
- if self.pattern_type:
275
- parts.append(f'type={self.pattern_type}')
276
- if self.variable:
277
- parts.extend(['AS', self.variable])
278
- return ' '.join(parts)
279
-
280
- def _include_in_repr(self, name: str, value: Any) -> bool:
281
- return bool(value)
282
-
283
280
  def visit(self, visitor: SuiteVisitor):
284
281
  visitor.visit_try_branch(self)
285
282
 
@@ -289,11 +286,24 @@ class TryBranch(BodyItem):
289
286
  data['patterns'] = self.patterns
290
287
  if self.pattern_type:
291
288
  data['pattern_type'] = self.pattern_type
292
- if self.variable:
293
- data['variable'] = self.variable
289
+ if self.assign:
290
+ data['assign'] = self.assign
294
291
  data['body'] = self.body.to_dicts()
295
292
  return data
296
293
 
294
+ def __str__(self) -> str:
295
+ if self.type != BodyItem.EXCEPT:
296
+ return self.type
297
+ parts = ['EXCEPT', *self.patterns]
298
+ if self.pattern_type:
299
+ parts.append(f'type={self.pattern_type}')
300
+ if self.assign:
301
+ parts.extend(['AS', self.assign])
302
+ return ' '.join(parts)
303
+
304
+ def _include_in_repr(self, name: str, value: Any) -> bool:
305
+ return bool(value)
306
+
297
307
 
298
308
  @Body.register
299
309
  class Try(BodyItem):
@@ -348,6 +358,49 @@ class Try(BodyItem):
348
358
  'body': self.body.to_dicts()}
349
359
 
350
360
 
361
+ @Body.register
362
+ class Var(BodyItem):
363
+ """Represents ``VAR``."""
364
+ type = BodyItem.VAR
365
+ repr_args = ('name', 'value', 'scope', 'separator')
366
+ __slots__ = ['name', 'value', 'scope', 'separator']
367
+
368
+ def __init__(self, name: str = '',
369
+ value: 'str|Sequence[str]' = (),
370
+ scope: 'str|None' = None,
371
+ separator: 'str|None' = None,
372
+ parent: BodyItemParent = None):
373
+ self.name = name
374
+ self.value = (value,) if isinstance(value, str) else tuple(value)
375
+ self.scope = scope
376
+ self.separator = separator
377
+ self.parent = parent
378
+
379
+ def visit(self, visitor: SuiteVisitor):
380
+ visitor.visit_var(self)
381
+
382
+ def to_dict(self) -> DataDict:
383
+ data = {'type': self.type,
384
+ 'name': self.name,
385
+ 'value': self.value}
386
+ if self.scope is not None:
387
+ data['scope'] = self.scope
388
+ if self.separator is not None:
389
+ data['separator'] = self.separator
390
+ return data
391
+
392
+ def __str__(self):
393
+ parts = ['VAR', self.name, *self.value]
394
+ if self.separator is not None:
395
+ parts.append(f'separator={self.separator}')
396
+ if self.scope is not None:
397
+ parts.append(f'scope={self.scope}')
398
+ return ' '.join(parts)
399
+
400
+ def _include_in_repr(self, name: str, value: Any) -> bool:
401
+ return value is not None or name in ('name', 'value')
402
+
403
+
351
404
  @Body.register
352
405
  class Return(BodyItem):
353
406
  """Represents ``RETURN``."""
@@ -364,8 +417,16 @@ class Return(BodyItem):
364
417
  visitor.visit_return(self)
365
418
 
366
419
  def to_dict(self) -> DataDict:
367
- return {'type': self.type,
368
- 'values': self.values}
420
+ data = {'type': self.type}
421
+ if self.values:
422
+ data['values'] = self.values
423
+ return data
424
+
425
+ def __str__(self):
426
+ return ' '.join(['RETURN', *self.values])
427
+
428
+ def _include_in_repr(self, name: str, value: Any) -> bool:
429
+ return bool(value)
369
430
 
370
431
 
371
432
  @Body.register
@@ -383,6 +444,9 @@ class Continue(BodyItem):
383
444
  def to_dict(self) -> DataDict:
384
445
  return {'type': self.type}
385
446
 
447
+ def __str__(self):
448
+ return 'CONTINUE'
449
+
386
450
 
387
451
  @Body.register
388
452
  class Break(BodyItem):
@@ -399,6 +463,9 @@ class Break(BodyItem):
399
463
  def to_dict(self) -> DataDict:
400
464
  return {'type': self.type}
401
465
 
466
+ def __str__(self):
467
+ return 'BREAK'
468
+
402
469
 
403
470
  @Body.register
404
471
  class Error(BodyItem):
@@ -421,3 +488,6 @@ class Error(BodyItem):
421
488
  def to_dict(self) -> DataDict:
422
489
  return {'type': self.type,
423
490
  'values': self.values}
491
+
492
+ def __str__(self):
493
+ return ' '.join(['ERROR', *self.values])
@@ -18,7 +18,7 @@ from typing import Sequence, TYPE_CHECKING
18
18
  from robot.utils import setter
19
19
 
20
20
  from .tags import TagPatterns
21
- from .namepatterns import SuiteNamePatterns, TestNamePatterns
21
+ from .namepatterns import NamePatterns
22
22
  from .visitor import SuiteVisitor
23
23
 
24
24
  if TYPE_CHECKING:
@@ -46,8 +46,8 @@ class EmptySuiteRemover(SuiteVisitor):
46
46
  class Filter(EmptySuiteRemover):
47
47
 
48
48
  def __init__(self,
49
- include_suites: 'SuiteNamePatterns|Sequence[str]|None' = None,
50
- include_tests: 'TestNamePatterns|Sequence[str]|None' = None,
49
+ include_suites: 'NamePatterns|Sequence[str]|None' = None,
50
+ include_tests: 'NamePatterns|Sequence[str]|None' = None,
51
51
  include_tags: 'TagPatterns|Sequence[str]|None' = None,
52
52
  exclude_tags: 'TagPatterns|Sequence[str]|None' = None):
53
53
  super().__init__()
@@ -57,12 +57,12 @@ class Filter(EmptySuiteRemover):
57
57
  self.exclude_tags = exclude_tags
58
58
 
59
59
  @setter
60
- def include_suites(self, suites) -> 'SuiteNamePatterns|None':
61
- return self._patterns_or_none(suites, SuiteNamePatterns)
60
+ def include_suites(self, suites) -> 'NamePatterns|None':
61
+ return self._patterns_or_none(suites, NamePatterns)
62
62
 
63
63
  @setter
64
- def include_tests(self, tests) -> 'TestNamePatterns|None':
65
- return self._patterns_or_none(tests, TestNamePatterns)
64
+ def include_tests(self, tests) -> 'NamePatterns|None':
65
+ return self._patterns_or_none(tests, NamePatterns)
66
66
 
67
67
  @setter
68
68
  def include_tags(self, tags) -> 'TagPatterns|None':
@@ -80,27 +80,33 @@ class Filter(EmptySuiteRemover):
80
80
  def start_suite(self, suite: 'TestSuite'):
81
81
  if not self:
82
82
  return False
83
- if hasattr(suite, 'starttime'):
84
- suite.starttime = suite.endtime = None
83
+ if hasattr(suite, 'start_time'):
84
+ suite.start_time = suite.end_time = suite.elapsed_time = None
85
85
  if self.include_suites is not None:
86
- if self.include_suites.match(suite.name, suite.longname):
87
- suite.visit(Filter(include_tests=self.include_tests,
88
- include_tags=self.include_tags,
89
- exclude_tags=self.exclude_tags))
90
- return False
91
- suite.tests = []
92
- return True
93
- if self.include_tests is not None:
94
- suite.tests = [t for t in suite.tests
95
- if self.include_tests.match(t.name, t.longname)]
96
- if self.include_tags is not None:
97
- suite.tests = [t for t in suite.tests
98
- if self.include_tags.match(t.tags)]
99
- if self.exclude_tags is not None:
100
- suite.tests = [t for t in suite.tests
101
- if not self.exclude_tags.match(t.tags)]
86
+ return self._filter_based_on_suite_name(suite)
87
+ suite.tests = [t for t in suite.tests if self._test_included(t)]
102
88
  return bool(suite.suites)
103
89
 
90
+ def _filter_based_on_suite_name(self, suite: 'TestSuite') -> bool:
91
+ if self.include_suites.match(suite.name, suite.full_name):
92
+ suite.visit(Filter(include_tests=self.include_tests,
93
+ include_tags=self.include_tags,
94
+ exclude_tags=self.exclude_tags))
95
+ return False
96
+ suite.tests = []
97
+ return True
98
+
99
+ def _test_included(self, test: 'TestCase') -> bool:
100
+ tests, include, exclude \
101
+ = self.include_tests, self.include_tags, self.exclude_tags
102
+ if exclude is not None and exclude.match(test.tags):
103
+ return False
104
+ if include is not None and include.match(test.tags):
105
+ return True
106
+ if tests is not None and tests.match(test.name, test.full_name):
107
+ return True
108
+ return include is None and tests is None
109
+
104
110
  def __bool__(self) -> bool:
105
111
  return bool(self.include_suites is not None or
106
112
  self.include_tests is not None or
@@ -0,0 +1,70 @@
1
+ # Copyright 2008-2015 Nokia Networks
2
+ # Copyright 2016- Robot Framework Foundation
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ from typing import Sequence, TYPE_CHECKING
17
+
18
+ from .body import Body, BodyItem, BodyItemParent
19
+ from .modelobject import DataDict
20
+
21
+ if TYPE_CHECKING:
22
+ from .visitor import SuiteVisitor
23
+
24
+
25
+ @Body.register
26
+ class Keyword(BodyItem):
27
+ """Base model for a single keyword.
28
+
29
+ Extended by :class:`robot.running.model.Keyword` and
30
+ :class:`robot.result.model.Keyword`.
31
+ """
32
+ repr_args = ('name', 'args', 'assign')
33
+ __slots__ = ['name', 'args', 'assign', 'type']
34
+
35
+ def __init__(self, name: 'str|None' = '',
36
+ args: Sequence[str] = (),
37
+ assign: Sequence[str] = (),
38
+ type: str = BodyItem.KEYWORD,
39
+ parent: BodyItemParent = None):
40
+ self.name = name
41
+ self.args = tuple(args)
42
+ self.assign = tuple(assign)
43
+ self.type = type
44
+ self.parent = parent
45
+
46
+ @property
47
+ def id(self) -> 'str|None':
48
+ if not self:
49
+ return None
50
+ return super().id
51
+
52
+ def visit(self, visitor: 'SuiteVisitor'):
53
+ """:mod:`Visitor interface <robot.model.visitor>` entry-point."""
54
+ if self:
55
+ visitor.visit_keyword(self)
56
+
57
+ def __bool__(self) -> bool:
58
+ return self.name is not None
59
+
60
+ def __str__(self) -> str:
61
+ parts = list(self.assign) + [self.name] + list(self.args)
62
+ return ' '.join(str(p) for p in parts)
63
+
64
+ def to_dict(self) -> DataDict:
65
+ data: DataDict = {'name': self.name}
66
+ if self.args:
67
+ data['args'] = self.args
68
+ if self.assign:
69
+ data['assign'] = self.assign
70
+ return data
@@ -13,12 +13,18 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- from robot.utils import html_escape
16
+ from datetime import datetime
17
+ from typing import Literal
18
+
19
+ from robot.utils import html_escape, setter
17
20
 
18
21
  from .body import BodyItem
19
22
  from .itemlist import ItemList
20
23
 
21
24
 
25
+ MessageLevel = Literal['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FAIL', 'SKIP']
26
+
27
+
22
28
  class Message(BodyItem):
23
29
  """A message created during the test execution.
24
30
 
@@ -27,22 +33,25 @@ class Message(BodyItem):
27
33
  """
28
34
  type = BodyItem.MESSAGE
29
35
  repr_args = ('message', 'level')
30
- __slots__ = ['message', 'level', 'html', 'timestamp']
36
+ __slots__ = ['message', 'level', 'html', '_timestamp']
31
37
 
32
- def __init__(self, message='', level='INFO', html=False, timestamp=None, parent=None):
33
- #: The message content as a string.
38
+ def __init__(self, message: str = '',
39
+ level: MessageLevel = 'INFO',
40
+ html: bool = False,
41
+ timestamp: 'datetime|str|None' = None,
42
+ parent: 'BodyItem|None' = None):
34
43
  self.message = message
35
- #: Severity of the message. Either ``TRACE``, ``DEBUG``, ``INFO``,
36
- #: ``WARN``, ``ERROR``, ``FAIL`` or ``SKIP`. The last two are only used
37
- #: with keyword failure messages.
38
44
  self.level = level
39
- #: ``True`` if the content is in HTML, ``False`` otherwise.
40
45
  self.html = html
41
- #: Timestamp in format ``%Y%m%d %H:%M:%S.%f``.
42
46
  self.timestamp = timestamp
43
- #: The object this message was triggered by.
44
47
  self.parent = parent
45
48
 
49
+ @setter
50
+ def timestamp(self, timestamp: 'datetime|str|None') -> 'datetime|None':
51
+ if isinstance(timestamp, str):
52
+ return datetime.fromisoformat(timestamp)
53
+ return timestamp
54
+
46
55
  @property
47
56
  def html_message(self):
48
57
  """Returns the message content as HTML."""
@@ -150,10 +150,7 @@ class ModelObject(metaclass=SetterAwareType):
150
150
 
151
151
  __ https://docs.python.org/3/library/copy.html
152
152
  """
153
- copied = copy.copy(self)
154
- for name in attributes:
155
- setattr(copied, name, attributes[name])
156
- return copied
153
+ return copy.copy(self).config(**attributes)
157
154
 
158
155
  def deepcopy(self: T, **attributes) -> T:
159
156
  """Return a deep copy of this object.
@@ -167,10 +164,7 @@ class ModelObject(metaclass=SetterAwareType):
167
164
 
168
165
  __ https://docs.python.org/3/library/copy.html
169
166
  """
170
- copied = copy.deepcopy(self)
171
- for name in attributes:
172
- setattr(copied, name, attributes[name])
173
- return copied
167
+ return copy.deepcopy(self).config(**attributes)
174
168
 
175
169
  def __repr__(self) -> str:
176
170
  arguments = [(name, getattr(self, name)) for name in self.repr_args]