[TIP] Fwd: doctest fixtures in nose

Olemis Lang olemis at gmail.com
Mon Jan 7 11:34:44 PST 2013


/me forwarding to the ML ... :-$

---------- Forwarded message ----------
From: Olemis Lang <olemis at gmail.com>
Date: Mon, 7 Jan 2013 14:33:29 -0500
Subject: Re: [TIP] doctest fixtures in nose
To: Barry Warsaw <barry at python.org>

On 1/7/13, Barry Warsaw <barry at python.org> wrote:
> On Jan 07, 2013, at 05:19 PM, Benji York wrote:
>
>>On Mon, Jan 7, 2013 at 4:35 PM, Barry Warsaw <barry at python.org> wrote:
>>> I opened this issue in nose's tracker:
>>>
>>> https://github.com/nose-devs/nose/issues/594
>>>
>>> and my thoughts were to add a --doctest-fixture (singular) option which
>>> would
>>> name a module using dotted-notation that would be the generic fixture.
>>> So
>>> e.g. I could add:
>>>
>>> --doctest-fixture=mypackage.subpkg.testing.doctest_fixture
>>>
>>> and nose would import that module as the fixture (i.e. it would be on
>>> sys.path).  I suggest allowing --doctest-fixtures (plural) to still allow
>>> for
>>> overriding doctest fixtures on a per-doctest basis.
>>
>>How would that work if you have several sets of tests, each with their
>>own fixtures?  Say, organized in a fixture-per-directory arrangement?
>
> That's a good question.
>

yes .

> In my own use cases, I have one fixture to rule all doctests, although I do
> occasionally use a different zope.testing layer for some doctests in a
> directory.  I hack this in by adding a `layer` attribute in the __init__.py
> in
> the doctest directory.
>

<OT maybe_helpful="true">
jftr ... dutest=0.2.4 includes test suites and loaders that may be
useful for this particular purpose . I use them to test Trac and
Apache™ Bloodhound plugins , especially creating the target
environment(s) just once ... there's a lot of room for enhancements in
there , of course ...
</OT>

[...]

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:



More information about the testing-in-python mailing list