Skip to content

Add more set assertion rewrites e.g. >=#11469

Merged
nicoddemus merged 7 commits intopytest-dev:mainfrom
reaganjlee:set-assertion
Oct 2, 2023
Merged

Add more set assertion rewrites e.g. >=#11469
nicoddemus merged 7 commits intopytest-dev:mainfrom
reaganjlee:set-assertion

Conversation

@reaganjlee
Copy link
Copy Markdown
Contributor

@reaganjlee reaganjlee commented Sep 27, 2023

This resolves #10617 and adds more powerful set assertion rewrites for comparisons other than equality ==. Previously, only == was supported for sets. Now, the additional following operations are supported: !=, <=, >=, <, and >.

@reaganjlee reaganjlee marked this pull request as draft September 27, 2023 03:23
@reaganjlee reaganjlee marked this pull request as ready for review September 27, 2023 03:46
@reaganjlee reaganjlee marked this pull request as draft September 27, 2023 18:13
parametrize tests

fix tests

working coverage test

combine existing set tests under class
switch out gte vs gt
@reaganjlee reaganjlee marked this pull request as ready for review September 29, 2023 00:39
Copy link
Copy Markdown
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks @reaganjlee, appreciate the contribution!

Comment thread changelog/10617.feature.rst Outdated
Comment thread testing/test_assertion.py Outdated
Comment thread testing/test_assertion.py Outdated
reaganjlee and others added 2 commits October 1, 2023 01:12
Update testing/test_assertion.py

Co-authored-by: Bruno Oliveira <[email protected]>

Update testing/test_assertion.py

Co-authored-by: Bruno Oliveira <[email protected]>

other clean
@nicoddemus
Copy link
Copy Markdown
Member

Thanks @reaganjlee!

Btw, I did check the coverage failures, and they are incorrect, those lines codecov is saying are not covered are in fact covered, not sure why the false negative.

@reaganjlee
Copy link
Copy Markdown
Contributor Author

Ah yeah was confused on that for a bit 😅 thanks for the heads up. Should we leave the extra coverage test test_operators_not_set_for_full_coverage() in or are there any other coverage tools to use to fix that?

@nicoddemus
Copy link
Copy Markdown
Member

Should we leave the extra coverage test test_operators_not_set_for_full_coverage()

That test was an attempt to fix the coverage errors? If the other tests already cover the functionality and test_operators_not_set_for_full_coverage is redundant, it can be removed.

@nicoddemus
Copy link
Copy Markdown
Member

Thanks @reaganjlee!

@nicoddemus nicoddemus merged commit 9bbfe99 into pytest-dev:main Oct 2, 2023
@reaganjlee reaganjlee deleted the set-assertion branch October 2, 2023 22:01
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.

Add more powerful set assertion rewrites for comparisons other than equality == (eg: <=, etc.)

2 participants