pytest-dev / pytest-dev/pytest
py.test, assertion for assertDictContainsSubset?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
self.assertDictContainsSubset is in unittest in Standard Library.
See https://github.com/python/cpython/blob/bbd3cf8/Lib/unittest/case.py#L1122.
Googled and looked around, I haven't seen a way to do it.
In py.test, assert <dict> in <dict2> should be the same as self.assertDictContainsSubset(dict, dict2.
Is this already a feature and I'm missing it? Is py.test open to a PR for it?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the referenced Lib/unittest/case.py implementation of assertDictContainsSubset and compare it with pytest's existing assertion behavior. Determine whether the proposed dict-in-dict syntax and its failure output fit pytest, then identify the relevant assertion tests and define coverage for the supported semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100