unittest. customizing tstloaders / discover()

G

Gelonida N

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 . . ..
 
T

Thomas Bach

Gelonida N said:
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…
 
G

Gelonida N

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?
 
T

Thomas Bach

Gelonida N said:
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
 
N

Nathan Rice

Nose is absolutely the way to go for your testing needs. You can put
"__test__ = False" in modules or classes to stop test collection.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top