Skip to content

py.test, assertion for assertDictContainsSubset? #2376

@tony

Description

@tony

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: rewriterelated to the assertion rewrite mechanismtopic: tracebacksrelated to displaying and handling of tracebackstype: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions