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

Getting error on empty Classes #126

Open
guilhermef opened this issue Mar 18, 2015 · 1 comment
Open

Getting error on empty Classes #126

guilhermef opened this issue Mar 18, 2015 · 1 comment

Comments

@guilhermef
Copy link
Collaborator

If I try to organize my test using empty classes, like this:

class NormalizeURL(TornadoHTTPContext):

    class WhenStartsWithHttp(TornadoHTTPContext):
        def topic(self):
            return loader._normalize_url('http://some.url')

        def should_return_same_url(self, topic):
            expect(topic).to_equal('http://some.url')

I get an error

Error in topic:
Function %s does not have a code property

Traceback (most recent call last):
        File "/Users/guilhermef/.virtualenvs/thumbor/lib/python2.7/site-packages/pyvows/runner/gevent.py", line 97, in _run_setup_and_topic
    topic_list = get_topics_for(topic_func, ctx_obj)
        File "/Users/guilhermef/.virtualenvs/thumbor/lib/python2.7/site-packages/pyvows/runner/utils.py", line 45, in get_topics_for
    raise RuntimeError('Function %s does not have a code property')
RuntimeError: Function %s does not have a code property

      Nested tests following this error have not been run.

I think It should be allowed to have empty classes, to keep tests organized.

@heynemann
Copy link
Owner

I think that if we do not find the "topic" method, we should use None as topic.

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

No branches or pull requests

2 participants