support load_tests protocol #13

Closed
jpellerin opened this Issue Jan 20, 2012 · 8 comments

Comments

Projects
None yet
4 participants
@jpellerin
Member

jpellerin commented Jan 20, 2012

This should be a separate loader plugin.

@jpellerin

This comment has been minimized.

Show comment Hide comment
@jpellerin

jpellerin Jan 25, 2012

Member

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.

Member

jpellerin commented Jan 25, 2012

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

This comment has been minimized.

Show comment Hide comment
@cjerdonek

cjerdonek May 21, 2012

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.

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

This comment has been minimized.

Show comment Hide comment
@jpellerin

jpellerin May 21, 2012

Member

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.

Member

jpellerin commented May 21, 2012

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

This comment has been minimized.

Show comment Hide comment
@cjerdonek

cjerdonek May 21, 2012

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?

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

This comment has been minimized.

Show comment Hide comment
@cjerdonek

cjerdonek May 21, 2012

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)

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)
@vikt0rs

This comment has been minimized.

Show comment Hide comment
@vikt0rs

vikt0rs Jun 2, 2015

just for information - was this ported into nose?

vikt0rs commented Jun 2, 2015

just for information - was this ported into nose?

@thedrow

This comment has been minimized.

Show comment Hide comment
@thedrow

thedrow Jun 6, 2015

Member

Not as far as I know.

Member

thedrow commented Jun 6, 2015

Not as far as I know.

@vikt0rs

This comment has been minimized.

Show comment Hide comment
@vikt0rs

vikt0rs Jun 10, 2015

snip

vikt0rs commented Jun 10, 2015

snip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment