-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
include a is_subset assert method #6367
Comments
pytest doesn't currently house any assertion functions -- this would be better done in some assertion library or plugin |
@asottile I was afraid that this may be the case. Now the big question is if there is another existing library or plugin which could host this assertion. I do really want to avoid creating another project for it. |
While @asottile is correct, I do wonder if we should perhaps have an official assertion library/plugin, as it solves practical problems. Immediately comes to mind how often I use But before we introduce assertions, I would like to see a possible list of "assertion helpers" that should be included, so we can take a look at the landscape and decide if this should be indeed a separate library (perhaps under pytest-dev directly) or introduced into pytest itself (I tend for the former, as it doesn't depend on the internals and might have a different release cycle than the core). This has been brought up before: #2376 |
I think it is common to want to assert that a nested dictonary is a subset of another one and it would be very useful to add such an assert function to pytest itself.
One good example is at https://stackoverflow.com/a/57675231/99834
The text was updated successfully, but these errors were encountered: