replacing __dict__ with an OrderedDict

Ian Kelly ian.g.kelly at gmail.com
Mon Jan 9 12:30:19 EST 2012


On Mon, Jan 9, 2012 at 9:59 AM, Ulrich Eckhardt
<ulrich.eckhardt at dominolaser.com> wrote:
> There is another dependency and that I'd call a logical dependency. This
> occurs when e.g. test X tests for an API presence and test Y tests the API
> behaviour. In other words, Y has no chance to succeed if X already failed.
> Unfortunately, there is no way to express this relation, there is no
> "@unittest.depends(test_X)" to decorate test_Y with (Not yet!). Each test
> would be the root of a tree of tests that it depends on. If a dependency
> fails already, you can either skip the tree or at least mark the following
> test failures as implicit failures, so that you can easily distinguish them
> from the root cause.

I can see where that could be useful.  On the other hand, if such a
decorator were included in unittest, I can already envision people
abusing it to explicitly enshrine their operational dependencies,
maybe even taking it as encouragement to write their tests in that
fashion.



More information about the Python-list mailing list