Skip to content

Conversation

jonathan-s
Copy link
Collaborator

Here we use linting to check that we don't get any duplicate function names in tests. Specifically F811 covers this.

We get some other linting for free, and have the possibility to expand on linting rules if we want.

So in that sense, perhaps using coverage for python test_*.py becomes redundant?

Copy link

codecov bot commented Feb 16, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.53%. Comparing base (d549fbe) to head (59e8c1c).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
tests/filters/test_addslashes.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #56      +/-   ##
==========================================
- Coverage   98.53%   98.53%   -0.01%     
==========================================
  Files          29       29              
  Lines        4909     4908       -1     
  Branches     1621     1621              
==========================================
- Hits         4837     4836       -1     
  Misses         62       62              
  Partials       10       10              

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

Copy link
Owner

@LilyFirefly LilyFirefly left a comment

Choose a reason for hiding this comment

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

Overall I like this, but there's a few questions I have.

I'd still prefer to keep measuring coverage for tests though - it provides that extra guarantee that the test code is actually being run as expected.

@jonathan-s
Copy link
Collaborator Author

I'd still prefer to keep measuring coverage for tests though

Fair enough, though there will likely be some false positives (ie coverage saying that we get reduced coverage) for some time if we go with using xfail. Which I think is a useful placeholder for tests that need fixing once they are possible.

Comment on lines +33 to +34
django_template = engines["django"].from_string(template) # noqa
rust_template = engines["rusty"].from_string(template) # noqa
Copy link
Owner

Choose a reason for hiding this comment

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

I missed it when reviewing before, but I think the reason ruff is complaining is because django_template and rust_template are unused.

Both test_addslashes01 and test_addslashes02 refer to a self.engine, but this doesn't exist because these aren't methods on a unittest test class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See #57

@LilyFirefly LilyFirefly merged commit 436ac0a into LilyFirefly:main Feb 16, 2025
4 of 6 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.

2 participants