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
proto_helpers should be moved somewhere outside of a 'test' module #6435
Comments
I think there may be some disagreement on whether it is an exception to the compatibility policy (see the comment on [ticket:6251#comment:4 #6251]. Also, a couple of questions:
|
They sorta suck. A lot of them are very specific to a particular case. Many of them encourage poor testing practices. Across the entire module, it's a total hodge podge. You might get something handy and clever, or you might get something that's nonsense. I'm going to be a bit of a jerk and suggest that some serious thought should go into the APIs we introduce elsewhere, rather than just moving the implementation of these things into a non-test package. See below for more, though.
There's test coverage for almost none of it. There's documentation for slightly more of it than that. I'd definitely encourage doing this in multiple steps. In this case, not because there's going to be a huge number of lines in the resulting diff, but because the work to figure out whether each piece is good or needs improvement is largely unrelated to the work for each other piece (however, at the same time, many of these APIs need to be considered in conjunction with each other - for example, As far as the improvements to be made, I will offer one suggestion to start things off.
At the risk of swinging back towards the jerk end of the spectrum, |
Replying to exarkun:
I'm starting to think we should have a rule where nobody can ever say "X sucks" (or even "X is great"). If we have a specific criticism (or praise), we ought to say what it is. For example:
It's OK to have specific things for specific cases. Do we need some general ones?
What poor testing practices? While I can see that many things in this module might encourage imperfect testing practices, it strikes me that everything in here encourages better testing practices than the other options, such as:
This is only jerky if you insist that it's necessary. If you're just suggesting that it might be good, it's helpful, that's true, and I agree :).
I completely agree. I really should have put something about doing this piecemeal into the ticket description originally; this is basically how I assumed we'd do it, sorry for not saying so.
This is a really great set of criticisms, thanks a lot - so good as to almost negate the unfortunate "sucks" comment up top ;-).
Here's a suggestion of a pattern I think we ought to be following for this: When you have a test fake with some attributes that are useful for "externally" verifying things (things that would normally be I/O to other systems) those attributes ought to go onto a separate object, and the factories for getting your test fakes ought to give you that other objects. So rather than:
something more like:
thoughts?
And let's not forget |
Link to github PR: #1137 |
I hope to have some more time to give this a full review, but I do have one thought: can we call this module
Thanks for this contribution! |
Replying to Heather White:
|
Reviewed over on Github. Thanks again! |
Thanks Heather! I hope we can get this re-reviewed / integrated soon. |
In changeset 4cade8b
|
proto_helpers
is an unfortunate sore thumb sticking out in CompatibilityPolicy; it's the only thing in a "test" package you can import. Especially as it grows, this is going to become awkward. Plus, it's intwisted.test
which is a module that, for all intents and purposes, is itself deprecated, because new tests should always go into a module for an appropriate package.Having made this exception, we should, of course, keep supporting it by having aliases there and not removing them for a good long while. However, we should also find a place with a more obviously public name to put things.
Searchable metadata
The text was updated successfully, but these errors were encountered: