Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test(commands): centralize all --help tests in a file to dedup code#1726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
bearomorphism wants to merge1 commit intocommitizen-tools:v4-11-0
base:v4-11-0
Choose a base branch
Loading
frombearomorphism:test-help

Conversation

@bearomorphism
Copy link
Collaborator

@bearomorphismbearomorphism commentedDec 13, 2025
edited
Loading

Test improvements

  1. Addressed the issues about missingskip_below_py_3_13 and missing forced consistent environment variables to reduce the chance of unnecessary file regression test failures.
  2. Extracted duplicated logics.

@codecov
Copy link

codecovbot commentedDec 13, 2025
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Pleaseupload report for BASE (v4-11-0@2072f8e).Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@##             v4-11-0    #1726   +/-   ##==========================================  Coverage           ?   97.84%           ==========================================  Files              ?       60             Lines              ?     2604             Branches           ?        0           ==========================================  Hits               ?     2548             Misses             ?       56             Partials           ?        0
FlagCoverage Δ
unittests97.84% <ø> (?)

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines -22 to -25
skip_below_py_3_13=pytest.mark.skipif(
sys.version_info< (3,13),
reason="The output message of argparse is different between Python 3.13 and lower than Python 3.13",
)
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The variable name itself does not reflect why we want to set this variable... this may make it hard for future contributors to understand the code correctly

Comment on lines +41 to +46
monkeypatch.setenv("COLUMNS","80")
monkeypatch.setenv("TERM","dumb")
monkeypatch.setenv("LC_ALL","C")
monkeypatch.setenv("LANG","C")
monkeypatch.setenv("NO_COLOR","1")
monkeypatch.setenv("PAGER","cat")
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Copied from AI output. I know COLUMNS is necessary, but not sure for the rest

@bearomorphism
Copy link
CollaboratorAuthor

@woile@Lee-W could you review this PR when you have a moment? This PR contains the resolution of error when someone is trying to update CLI--help description. Some other PRs updating CLI options have dependencies on this PR.

Thanks!

@woile
Copy link
Member

I don't understand what this is supposed to fix

@bearomorphism
Copy link
CollaboratorAuthor

I don't understand what this is supposed to fix

The behavior of--help of argparse is different in some cases between python 3.13 and below 3.13 as the message of originalskip_below_py_3_13 says. Some of--help tests still usesskip_below_py_3_10 before this PR, and those tests still pass in the pipeline luckily.

When we try to add new options to the CLI, the help text changes, and usually we runpytest --regen-all to regenerate the file_regression test file, but the regenerated content may be different depends on the local environment (monkeypatch in this PR addresses this issue).

@bearomorphism
Copy link
CollaboratorAuthor

The following pipeline result is a false alarm test failure caused by forgetting to skip the test below python 3.13.

https://github.com/commitizen-tools/commitizen/actions/runs/20207591917/job/58008470452?pr=1724

Test passes for python version 3.13, 3.14 but not on 3.10

This PR can fix it.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@woilewoileAwaiting requested review from woilewoile is a code owner

@Lee-WLee-WAwaiting requested review from Lee-WLee-W is a code owner

@noirbizarrenoirbizarreAwaiting requested review from noirbizarrenoirbizarre is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@bearomorphism@woile

[8]ページ先頭

©2009-2025 Movatter.jp