Support later python features such as Python 3.10 feature "Structural Pattern Matching"
还没有人认领这个 Issue。
评估
调研方向
Start by reading the Python runner's parsing entry point and checking which parser version it uses; the issue does not name a file or test. Reproduce with the supplied match/case example under Python 3.10, then check whether parsing succeeds. Done means Gauge accepts the example without the reported parse error.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
If I want to use the match-case pattern, I can see parse error in the output. I could not find any information which Python versions are officially supported by this plugin. The only information I could find is the file "setup.tmpl" with the newest Python version 3.7.
Please use the following screenshot as the easiest way to reproduce it. This is not how I want to use the match-case in production.
To Reproduce
Steps (or project) to reproduce the behavior:
- Initialise a gauge project:
gauge init python - Use the following piece of code:
@step("Almost all words have vowels <table>")
def assert_words_vowel_count(table: Table):
for row in table:
word = str(row[0])
match word:
case "Gauge":
assert number_of_vowels(word) == 3
case "Mingle":
assert number_of_vowels(word) == 2
case "Snap" | "GoCD":
assert number_of_vowels(word) == 1
case "Rhythm":
assert number_of_vowels(word) == 0
case _:
assert False
- Run the gauge command
- See error
Logs
Failed to parse c:\xxx\gauge_match_case_example\step_impl\step_impl.py: The only possible keyword before an atomtrailers is 'await', not 'match'
Expected behavior
I can use Python 3.10 features like the Structural Pattern Matching.
Versions:
- Windows 10 Enterprise 21H2
- Python version 3.10.9
Gauge version: 1.5.4
Commit Hash: 30a0c23
Plugins
-------
html-report (4.2.0)
json-report (0.3.7)
python (0.4.1)
screenshot (0.1.0)
- 主要语言
- Python
- 星标
- 96
- 派生
- 38
- 平均合并
- 1 小时 18 分钟
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getgauge/gauge-python 的其他 Issue
-
GAUGE_PYTHON_COMMAND does not support relative paths (e.g. .venv/bin/python)可能已有人在做 @JakubStyczen 于 40 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
getgauge/gauge-python#485 ·
-
bug help wanted
难度 3/5 1-2 天 新手友好度 42/100
getgauge/gauge-python#460 · 1 条评论 ·
-
help wanted
难度 3/5 1-2 天 新手友好度 35/100
getgauge/gauge-python#265 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
getgauge/gauge-python#245 ·
-
help wanted triage
难度 1/5 1 小时以内 新手友好度 35/100
getgauge/gauge-python#123 · 1 条评论 ·
查看 getgauge/gauge-python 的全部 Issue
相似的 Issue
-
request-theme
难度 1/5 1 小时以内 新手友好度 66/100
LizardByte/ThemerrDB#9575 ·
维护者通常 1 天内回复
-
author-page correction
难度 2/5 1-3 小时 新手友好度 62/100
acl-org/acl-anthology#10599 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
zilliztech/memsearch#818 ·
维护者通常 1 天内回复
-
[FAQ] Commit ID for Projects可能已有人在做 @github-actions 今天认领。 未关闭faq-proposal
难度 1/5 1 小时以内 新手友好度 84/100
DataTalksClub/faq#503 · 1 条评论 ·
维护者通常 2 天内回复
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-free可能已有人在做 @Aaqibhafeezkhan 今天认领。 未关闭beginner documentation good first issue
难度 2/5 1-3 小时 新手友好度 75/100
BistaDinesh03/critique#164 · 1 条评论 ·
维护者通常 1 天内回复