Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to customize selector logic #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shiraeeshi
Copy link

Here are some new options to support a use case mentioned in this question:
--with-inherited - allows to run inherited methods as tests
--with-undefined - allows to run methods that was not defined in the class, but was added later
--with-tools-decorators - lets istest, nottest decorators contribute to selector logic
--with-tools-decorators-only - runs only those functions and methods that was decorated with istest (a class containing a method should also be decorated)

@@ -20,6 +20,18 @@ def private(obj):

class SpecSelector(nose.selector.Selector):
def __init__(self, *args, **kwargs):
self._with_inherited = kwargs.has_key("spec_with_inherited") and kwargs["spec_with_inherited"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason these are all doing has_key + value obtain + del, and not simply self._xxx = kwargs.pop("spec_xxx", False)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, now the code is much simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants