testing-cabal / testtools

Testtools - tasteful testing for python
https://testtools.readthedocs.io/en/latest/
Other
95 stars 88 forks source link

Extract TestRecord object from StreamToDict #158

Closed jml closed 8 years ago

jml commented 9 years ago

Many places in testtools.testresult.real refer to "a dict as generated by StreamToDict" or similar. This patch dignifies it with a real name in Python, TestRecord

The new TestRecord object encapsulates most of the information in the dict and has been extracted from StreamToDict.

I've made it inherit from pyrsistent.PClass to make it immutable. I think this is a desirable property, but not essential to the patch. We could make it mutable with attrs, or by rolling our own object like in the olden days.

Notes

I'm looking at re-using some code from testtools.testresult. This patch is in the spirit of "building understanding into existing code".

Review on Reviewable

jml commented 9 years ago

This is now ready for review.

jml commented 8 years ago

Occurred to me that I didn't want to expose these yet. For now, it should just be an internal refactoring.