Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #16988 > unrolled thread

unittest. customizing tstloaders / discover()

Started byGelonida N <gelonida@gmail.com>
First post2011-12-11 22:27 +0100
Last post2011-12-12 11:50 -0500
Articles 5 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  unittest. customizing tstloaders / discover() Gelonida N <gelonida@gmail.com> - 2011-12-11 22:27 +0100
    Re: unittest. customizing tstloaders / discover() Thomas Bach <bachth@uni-mainz.de> - 2011-12-12 00:27 +0100
      Re: unittest. customizing tstloaders / discover() Gelonida N <gelonida@gmail.com> - 2011-12-12 02:32 +0100
        Re: unittest. customizing tstloaders / discover() Thomas Bach <bachth@uni-mainz.de> - 2011-12-12 11:44 +0100
          Re: unittest. customizing tstloaders / discover() Nathan Rice <nathan.alexander.rice@gmail.com> - 2011-12-12 11:50 -0500

#16988 — unittest. customizing tstloaders / discover()

FromGelonida N <gelonida@gmail.com>
Date2011-12-11 22:27 +0100
Subjectunittest. customizing tstloaders / discover()
Message-ID<mailman.3518.1323638859.27778.python-list@python.org>
Hi,

I'd like to have a custom test loder, which will filter out certain
tests or which just searches tests in certain directories.

I'd like to use regular expresions as include / exclude rules
and I would like to have another filter function, which would check for
the existence of certain metavariabels in test suite files


WHat would be the best starting point for such an example.

Thanks a lot in advance for any info / pointer /tutorial . . ..

[toc] | [next] | [standalone]


#16992

FromThomas Bach <bachth@uni-mainz.de>
Date2011-12-12 00:27 +0100
Message-ID<87y5uiu1t4.fsf@jubold.box>
In reply to#16988
Gelonida N <gelonida@gmail.com> writes:

> I'd like to use regular expresions as include / exclude rules
> and I would like to have another filter function, which would check for
> the existence of certain metavariabels in test suite files

Did you have a look at nose? I'm using it and it supports
include/exclude rules via RE and lets you select directories to run
tests from.

I'm not sure about the meta-variable thing, but it supports plug ins
that could do the trick…

[toc] | [prev] | [next] | [standalone]


#17001

FromGelonida N <gelonida@gmail.com>
Date2011-12-12 02:32 +0100
Message-ID<mailman.3525.1323653551.27778.python-list@python.org>
In reply to#16992
On 12/12/2011 12:27 AM, Thomas Bach wrote:
> Gelonida N <gelonida@gmail.com> writes:
> 
>> I'd like to use regular expresions as include / exclude rules
>> and I would like to have another filter function, which would check for
>> the existence of certain metavariabels in test suite files
> 
> Did you have a look at nose? I'm using it and it supports
> include/exclude rules via RE and lets you select directories to run
> tests from.
> 
> I'm not sure about the meta-variable thing, but it supports plug ins
> that could do the trick…
> 

I looked at nose very briefly, but too short to form a real opinion
and to understand whether nose would have any negative impact on
existing unit tests.

Do I loose anything if using nose. or example can all unit tests / doc
tests still be run from nose?


[toc] | [prev] | [next] | [standalone]


#17028

FromThomas Bach <bachth@uni-mainz.de>
Date2011-12-12 11:44 +0100
Message-ID<8739cqf4so.fsf@jubold.box>
In reply to#17001
Gelonida N <gelonida@gmail.com> writes:

> Do I loose anything if using nose. or example can all unit tests / doc
> tests still be run from nose?

AFAIK you don't loose anything by using nose – the unittests should all
be found and doctests can be run via `--with-doctest', I never used
doctests though.

regards

[toc] | [prev] | [next] | [standalone]


#17063

FromNathan Rice <nathan.alexander.rice@gmail.com>
Date2011-12-12 11:50 -0500
Message-ID<mailman.3560.1323708658.27778.python-list@python.org>
In reply to#17028
Nose is absolutely the way to go for your testing needs.  You can put
"__test__ = False" in modules or classes to stop test collection.

On Mon, Dec 12, 2011 at 5:44 AM, Thomas Bach <bachth@uni-mainz.de> wrote:
> Gelonida N <gelonida@gmail.com> writes:
>
>> Do I loose anything if using nose. or example can all unit tests / doc
>> tests still be run from nose?
>
> AFAIK you don't loose anything by using nose – the unittests should all
> be found and doctests can be run via `--with-doctest', I never used
> doctests though.
>
> regards
> --
> http://mail.python.org/mailman/listinfo/python-list

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web