Title: Bug: test_invalid_command fails on Python 3.12 · Issue #1864 · commitizen-tools/commitizen · GitHub
Open Graph Title: Bug: test_invalid_command fails on Python 3.12 · Issue #1864 · commitizen-tools/commitizen
X Title: Bug: test_invalid_command fails on Python 3.12 · Issue #1864 · commitizen-tools/commitizen
Description: Description The test_invalid_command fails specifically on Python 3.12. Interestingly, the test passes as expected on Python 3.10, 3.11, 3.13, and 3.14. On Python 3.12, argparse produces an error message with single quotes around choices...
Open Graph Description: Description The test_invalid_command fails specifically on Python 3.12. Interestingly, the test passes as expected on Python 3.10, 3.11, 3.13, and 3.14. On Python 3.12, argparse produces an error m...
X Description: Description The test_invalid_command fails specifically on Python 3.12. Interestingly, the test passes as expected on Python 3.10, 3.11, 3.13, and 3.14. On Python 3.12, argparse produces an error m...
Opengraph URL: https://github.com/commitizen-tools/commitizen/issues/1864
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: test_invalid_command fails on Python 3.12","articleBody":"### Description\n\nThe test_invalid_command fails specifically on Python 3.12. Interestingly, the test passes as expected on Python 3.10, 3.11, 3.13, and 3.14.\n\nOn Python 3.12, argparse produces an error message with single quotes around choices, but our current regression reference for 3.12 expects the \"no-quote\" format (which is the standard in 3.13+). This inconsistency causes a mismatch only in the 3.12 environment.\n### Steps to reproduce\n\n1. Use a Python 3.12.3 environment.\n2. Run the test suite:\n `uv run pytest tests/test_cli.py::test_invalid_command`\n3. Observe the `AssertionError` from `file_regression.check`.\n\n### Current behavior\n\nThe test fails because the obtained output contains single quotes around the valid choices, whereas the reference file does not.\nDiff output:\n\n\u003cimg width=\"3347\" height=\"64\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/26b76c86-ad24-4d9b-b963-afe3bdfd7a79\" /\u003e\n\n### Desired behavior\n\nThe regression files for Python 3.12 should be standardized. We need to decide whether Python 3.12 should strictly follow the \"no quotes\" format or if the reference files need an update to accommodate the specific minor version of Python 3.12 being used.\n\n### Screenshots\n\n\u003cimg width=\"3456\" height=\"1068\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/eabbbc6d-de90-47b1-9016-4cab1aba7edd\" /\u003e\n\n\u003cimg width=\"2494\" height=\"1684\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/68cb27f5-263a-477a-8c95-d2938c093ddd\" /\u003e\n\n### Environment\n\nCommitizen Version: 4.13.6\nPython Version: \n- Python 3.10.19, PASS\n- Python 3.11.14, PASS\n- Python 3.12.3, FAIL\n- Python 3.13.12, PASS\n- Python 3.14.3, PASS\n\nOperating System: Linux","author":{"url":"https://github.com/lostinth1cho","@type":"Person","name":"lostinth1cho"},"datePublished":"2026-02-10T08:07:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1864/commitizen/issues/1864"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3cd0bcb4-610d-e4ac-0880-91a20be99aca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A736:13657F:C46BB1:11F1E56:6A4E25BF |
| html-safe-nonce | 009a195794055984639439356a32906f81d8e68b0124100a6f8f4973ed1e9060 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzM2OjEzNjU3RjpDNDZCQjE6MTFGMUU1Njo2QTRFMjVCRiIsInZpc2l0b3JfaWQiOiI3MTA3OTkzNjgzNDkyNzQyNTkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fedc379a01fe2583915198d806f58773eb404446d79166a970bea56a53d29144 |
| hovercard-subject-tag | issue:3920033913 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/commitizen-tools/commitizen/1864/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f542af4289d9a74130ac0bf1118a89f0c6435659d863778f69a6760b8ceb37c0/commitizen-tools/commitizen/issues/1864 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f542af4289d9a74130ac0bf1118a89f0c6435659d863778f69a6760b8ceb37c0/commitizen-tools/commitizen/issues/1864 |
| og:image:alt | Description The test_invalid_command fails specifically on Python 3.12. Interestingly, the test passes as expected on Python 3.10, 3.11, 3.13, and 3.14. On Python 3.12, argparse produces an error m... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lostinth1cho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git |
| octolytics-dimension-user_id | 62252524 |
| octolytics-dimension-user_login | commitizen-tools |
| octolytics-dimension-repository_id | 106127589 |
| octolytics-dimension-repository_nwo | commitizen-tools/commitizen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 106127589 |
| octolytics-dimension-repository_network_root_nwo | commitizen-tools/commitizen |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d9dd20d38f8ae3c4cb6b597807431db300d0bd2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width