-
Notifications
You must be signed in to change notification settings - Fork 88
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
Possibly splitting matchers into its own package? #145
Comments
👍 |
I'm in favour, especially if the package makes it easy to use in regular & Matchers are mostly lifeless's thing, so will wait for his approval. (Also, On Thu, 18 Jun 2015 at 00:18 Christopher Armstrong [email protected]
|
While thinking about this ticket, I happened across three other projects that do things very similar to testtools.matchers, as separate libraries:
with varying support for producing useful human-oriented mismatch messages. I don't know what the testtools developers may gain from this information, I'm just making it available. |
@jml one thing in particular that makes testtools matchers useful in contexts other than testtools-based unit tests is this class: https://github.com/rackerlabs/otter/blob/bbb03e94464c7c66df7000a7f48a73a880cb3fe0/otter/test/utils.py#L46 This wraps any matcher in an object supporting |
I'm fine with it being split out. We created matchers in the first place because hamcrest seemed so unpythonic. I think the API is pretty settled now though. |
So would the work involved be:
|
Yes; I think filter-branch would be appropriate - preserve the history of the matcher repo; then commits on top of that to reorganise the namespace etc. I don't think we should deprecate the location straight off - give it time to bake a little. If you can prep a filter-branch + some cleanups on top somewhere, I'll make the new repo and register it with pypi and rtd and pull it in here (after mk1 eyeball review ;)). |
@rbtcollins - sounds good - I can just make as a personal repo sometime this weekend, and either we can transfer ownership or push to a new location. Any suggestions for a name? |
@cyli The least terrible name I can think of is "matcherz". Other suggestions welcome. |
Just curious: did @cyli ever get around to pulling out a separate package for the matchers? Boy, that'd be really useful to me right about now! :) If so, does anyone have the URL for the repo? |
I've found myself using matchers a lot for non-testing related purposes. It's a very clear way of describing an object, and seems more so than writing your own callable.
It also seems particularly useful as an easy way to write validators for expected JSON input, etc., if you are using it for something small and you don't want to write a full JSON schema for instance.
It might also be useful for something like the attrs library, for specifying custom validators.
The mismatch reporting is also pretty great.
It seems like a pretty useful tool for people to use, but it might get more visibility if detached from testtools. Right now the documentation is part of the testtools documentation, and people might not learn about it unless they're looking for a testing utility.
As it seems like it can stand on its own, maybe splitting it off into its own package and documentation/example usages outside of testing might encourage more usage and contributions?
The text was updated successfully, but these errors were encountered: