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

@focus decorator #54

Open
heynemann opened this issue Nov 17, 2012 · 3 comments
Open

@focus decorator #54

heynemann opened this issue Nov 17, 2012 · 3 comments

Comments

@heynemann
Copy link
Owner

Create a context decorator called focus. This would tell pyVows that it only needs to run the specified context. This is very useful when trying to fix a specific context.

Of course all the parent contexts need to be run as well.

Would be something like:

class SomeContext(Vows.Context):
    def topic(self):
        return 42

    class SomeChildContext(Vows.Context):
        def should_be_42(self, topic):
            expect(topic).to_equal(42)        

    @focus
    class OtherChildContext(Vows.Context):
        def should_be_42(self, topic):
            expect(topic).to_equal(42)        

In the above example, both SomeContext and OtherChildContext should be run, but not SomeChildContext.

@Zearin
Copy link
Collaborator

Zearin commented Jan 6, 2013

See also #22.

@heynemann
Copy link
Owner Author

Note that this is not the same as running a single vow from the command line. I'd even say that if this is implemented we don't need to run a single vow from the command line.

@ssteinbach
Copy link

Does having the decorator make implementing the commandline argument easier? If I had to pick one, I'd prefer to have the commandline argument, however best would be to have both.

Could the commandine argument apply the focus decorator at run time?

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

No branches or pull requests

3 participants