Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

support load_tests protocol #13

Closed
jpellerin opened this Issue · 8 comments

4 participants

@jpellerin
Owner

This should be a separate loader plugin.

@jpellerin
Owner

Removed from 0.2 milestone, as it's not clear to me yet how to implement it as a standalone plugin. See description of load_tests protocol here: http://docs.python.org/library/unittest.html#load-tests-protocol.

@cjerdonek

A couple comments:

Why wouldn't you want nose to support the load_tests protocol by default? It seems like nose should discover at least those tests discovered by unittest.

Also, I experienced a related problem whereby nose interpreted my load_tests() function as a test itself (because it matched the default regular expression), and a failing test at that. This required a hack to get around. At the least, perhaps nose could not interpret anything called "load_tests" as a test.

Forgive me if my comments are outdated or don't add to what you already know, as I'm not an expert nose user. Thanks.

@jpellerin
Owner

Basically everything in nose2 is implemented as a plugin -- so being a plugin doesn't mean load_tests wouldn't be on by default. I expect it would be, since it's unittest2 core feature.

We'll definitely also have to exclude load_tests from normal test collection. Good news is, this is next on my todo list. Bad news, I still don't know how to do it and it might slip again.

@cjerdonek

That sounds great. And thanks for the quick response!

Re: load_tests, I poked around in the code a bit. I'm now curious as to how load_tests is even being picked up (perhaps it's not in nose2). I only see a testMethodPrefix attribute being used, which doesn't apply of course. And there doesn't seem to be a corresponding suffix string or use of endswith (or even a testMatch regular expression as described in these docs).

Separate from my observations, what is the difficulty you see in skipping load_tests?

@cjerdonek

Yes, it looks like perhaps the second part of my comment is only applicable to nose and not nose2. nose2 doesn't seem to have code like the following (from here):

self.testMatchPat = env.get('NOSE_TESTMATCH',
                            r'(?:^|[\b_\.%s-])[Tt]est' % os.sep)
@jpellerin jpellerin closed this
@vikt0rs

just for information - was this ported into nose?

@thedrow
Collaborator

Not as far as I know.

@vikt0rs

snip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.