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(cli): convert CLI shell tests to pytest test cases#1086

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

Merged
max-wittig merged 1 commit intomasterfromtest/pytest-cli-tests
Apr 29, 2020

Conversation

nejch
Copy link
Member

@nejchnejch commentedApr 26, 2020
edited
Loading

An initial attempt at unifying the testing approach 😁

This PR uses thepytest-console-scripts plugin and provides agitlab_cli() wrapper for tests, so people can addgitlab CL subcommands as a list and include variables (from the test case or from fixtures) to assert against.

I'm unsure if this is really the best approach, but I've already been impressed while building this by how much more detail pytest provides for each error/failure, even when running CLI tests. If I did the fixtures right, they should also later be reusable for API functional tests. :P

For now I've not split the tests yet, to make reviews easier (1 shell test -> 1 pytest test), which makes the file quite long. I guess it would also make sense to split them. This would be better anyway, and this should make tests not depend on each other (I'malmost there even now - still have a few todos for some fixtures).

If this approach makes sense I can add some docs on how to contribute tests to make it more accessible for new contributors, :)

An example run is here:https://travis-ci.org/github/python-gitlab/python-gitlab/jobs/679739257

Edit: I've also not yet put this insidegitlab/tests yet, to avoid hacking the tox scripts, but I guess the structure will also be a topic

@nejchnejch marked this pull request as ready for reviewApril 26, 2020 15:28
@nejchnejch requested a review frommax-wittigApril 26, 2020 15:28
@nejchnejchforce-pushed thetest/pytest-cli-tests branch from966a161 toc4ab4f5CompareApril 26, 2020 19:24
@codecov-io
Copy link

Codecov Report

Merging#1086 intomaster willnot change coverage.
The diff coverage isn/a.

Impacted file tree graph

@@           Coverage Diff           @@##           master    #1086   +/-   ##=======================================  Coverage   76.68%   76.68%           =======================================  Files          10       10             Lines        2758     2758           =======================================  Hits         2115     2115             Misses        643      643

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update91c1c27...c4ab4f5. Read thecomment docs.

@max-wittigmax-wittig merged commit74b3ddc intomasterApr 29, 2020
@max-wittigmax-wittig deleted the test/pytest-cli-tests branchApril 29, 2020 10:07
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@max-wittigmax-wittigmax-wittig approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@nejch@codecov-io@max-wittig

[8]ページ先頭

©2009-2025 Movatter.jp