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

Basic setup not working #54

Closed
AMeng opened this issue May 21, 2015 · 3 comments
Closed

Basic setup not working #54

AMeng opened this issue May 21, 2015 · 3 comments

Comments

@AMeng
Copy link

AMeng commented May 21, 2015

I'm seeing a traceback when trying to run the command line tool with no arguments:

Traceback (most recent call last):
  File "/test/env/bin/specter", line 11, in <module>
    sys.exit(activate())
  File "/test/env/local/lib/python2.7/site-packages/specter/runner.py", line 188, in activate
    runner.run(args)
  File "/test/env/local/lib/python2.7/site-packages/specter/runner.py", line 153, in run
    module_name=self.arguments.select_module)
  File "/test/env/local/lib/python2.7/site-packages/specter/scanner.py", line 38, in scan
    classes = rlist_classes(module, cls_filter=Describe.plugin_filter)
  File "/test/env/local/lib/python2.7/site-packages/pynsive/reflection.py", line 237, in rlist_classes
    mnames = rlist_modules(module)
  File "/test/env/local/lib/python2.7/site-packages/pynsive/reflection.py", line 179, in rlist_modules
    module = import_module(mname)
  File "/test/env/local/lib/python2.7/site-packages/pynsive/common.py", line 16, in import_module
    return importlib.import_module(module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named spec

This is in a new virtual environment with only specter==0.2.1 installed through pip.

I have a directory called spec in my project folder which contains a single test file called my_spec.py. It contains the first example from the documentation:

from specter import Spec, expect
class SampleSpec(Spec):
    def it_can_create_an_object(self):
        expect('something').to.equal('something')

I'm on Python 2.7.9.

@jmvrbanac
Copy link
Owner

Interesting... is the spec folder a python package? i.e. does it have a __init__.py within the spec folder?

@AMeng
Copy link
Author

AMeng commented May 22, 2015

That was the issue 😄

@jmvrbanac
Copy link
Owner

Awesome! I'm glad that took care of the issue. I've added an issue (#55) to help address the obscurity of that error. It really should produce a more informative error for users. Thanks for bringing this up!

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