Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent pytest from collecting tests on testing.TestClient #2148

Merged
merged 7 commits into from Jun 3, 2023

Conversation

aryaniyaps
Copy link
Contributor

@aryaniyaps aryaniyaps commented Apr 5, 2023

Summary of Changes

prevent pytest from collecting tests on testing.TestClient

Related Issues

fixes #2147

Pull Request Checklist

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.

  • Applied changes to both WSGI and ASGI code paths and interfaces (where applicable).
  • Added tests for changed code.
  • Prefixed code comments with GitHub nick and an appropriate prefix.
  • Coding style is consistent with the rest of the framework.
  • Updated documentation for changed code.
    • Added docstrings for any new classes, functions, or modules.
    • Updated docstrings for any modifications to existing code.
    • Updated both WSGI and ASGI docs (where applicable).
    • Added references to new classes, functions, or modules to the relevant RST file under docs/.
    • Updated all relevant supporting documentation files under docs/.
    • A copyright notice is included at the top of any new modules (using your own name or the name of your organization).
    • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives.
  • Changes (and possible deprecations) have towncrier news fragments under docs/_newsfragments/, with the file name format {issue_number}.{fragment_type}.rst. (Run towncrier --draft to ensure it renders correctly.)

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

PR template inspired by the attrs project.

@CaselIT CaselIT requested a review from vytas7 April 5, 2023 08:25
CaselIT
CaselIT previously approved these changes Apr 5, 2023
kgriffs
kgriffs previously approved these changes Apr 5, 2023
@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Merging #2148 (20e8eb4) into master (200a853) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #2148   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           62        62           
  Lines         6789      6791    +2     
  Branches      1095      1095           
=========================================
+ Hits          6789      6791    +2     
Impacted Files Coverage Δ
falcon/testing/client.py 100.00% <100.00%> (ø)
falcon/testing/test_case.py 100.00% <100.00%> (ø)

@aryaniyaps aryaniyaps dismissed stale reviews from kgriffs and CaselIT via c4538ee April 8, 2023 10:39
Copy link
Member

@vytas7 vytas7 left a comment

Choose a reason for hiding this comment

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

Hey there, thanks for this PR, it looked good bar some extraneous whitespace that made the flake8 and blue checks fail.

However, in your latest commit you changed virtually every line of the whole codebase, we'll need to revert this one 😅

@aryaniyaps aryaniyaps requested a review from vytas7 April 16, 2023 05:02
Copy link
Member

@vytas7 vytas7 left a comment

Choose a reason for hiding this comment

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

Hi again, still the same problem. Your PR proposes to change 68706 lines, basically the whole codebase, while I expect this fix to consist of 2-3 lines plus maybe a newsfragment. You need to revert unrelated changes before we can proceed with this.

@aryaniyaps
Copy link
Contributor Author

Hi again, still the same problem. Your PR proposes to change 68706 lines, basically the whole codebase, while I expect this fix to consist of 2-3 lines plus maybe a newsfragment. You need to revert unrelated changes before we can proceed with this.

I'm actually unsure on how to revert it. Maybe a new PR? or are there any commands to execute locally?

@CaselIT
Copy link
Member

CaselIT commented Apr 17, 2023

Hi again, still the same problem. Your PR proposes to change 68706 lines, basically the whole codebase, while I expect this fix to consist of 2-3 lines plus maybe a newsfragment. You need to revert unrelated changes before we can proceed with this.

I'm actually unsure on how to revert it. Maybe a new PR? or are there any commands to execute locally?

sure, feel free to close this and reopen a new PR. An alternative may be to force push on this branch applying your original change to master

@rite2hhh
Copy link

rite2hhh commented May 2, 2023

Hi again, still the same problem. Your PR proposes to change 68706 lines, basically the whole codebase, while I expect this fix to consist of 2-3 lines plus maybe a newsfragment. You need to revert unrelated changes before we can proceed with this.

I'm actually unsure on how to revert it. Maybe a new PR? or are there any commands to execute locally?

Looks like a classic CRLF (Windows) vs LF (Unix) issue

If you're using vscode look at the bottom right.

image

In this image it says LF, if you used a Windows system to make changes, yours probably says CRLF.
Change it back to LF. If not, find a different way to revert that and you should be good to go.

Most repos use Unix convention of LF as the end-of-line character.

See: https://stackoverflow.com/questions/1967370/git-replacing-lf-with-crlf

vytas7
vytas7 previously approved these changes Jun 3, 2023
Copy link
Member

@vytas7 vytas7 left a comment

Choose a reason for hiding this comment

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

Thanks for bringing this up @aryaniyaps! 👍
I took the liberty of cleaning whitespace and line endings, as well as adding a newsfragment.

@vytas7
Copy link
Member

vytas7 commented Jun 3, 2023

And thanks for some good tips @rite2hhh!

FWIW, I have now added .editorconfig to the master branch, so if one's editor of choice (or its plugins) supports this standard, the editor should pick up Unix line endings correctly.

@vytas7 vytas7 merged commit b16b6c3 into falconry:master Jun 3, 2023
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent Pytest from collecting tests from falcon.testing.TestClient
5 participants