alfredodeza / konira

beautiful (readable) testing in Python
60 stars 9 forks source link

Konira is removing the current directory from the PYTHON path #12

Closed igorgue closed 13 years ago

igorgue commented 13 years ago

I tried to run the example here: http://konira.cafepais.com/docs/basic_structure.html

And it's unable to find the current directory modules. A look at sys.path shows that the first path isn't ''.

This is the output I get

(testingkonira)‹python-2.7.2› ~/code/testingkonira konira 
Errors:
-------
1 ==> ImportError: No module named foo
File: /Users/igor/code/testingkonira/case_foo.py:1:
No cases/specs collected.

A workaround this issue would be:

(testingkonira)‹python-2.7.2› ~/code/testingkonira PYTHONPATH=. konira    
the foo class
    It has a bar method that always returns true
All 1 spec passed in 0.127 secs.
igorgue commented 13 years ago

It also fixes this if you add ./ to your .zshrc:

export PYTHONPATH=./:"`brew --prefix python`/lib/python2.7/site-packages"
alfredodeza commented 13 years ago

That is a workaround but this is a Konira issue.

Thanks for reporting and it has been fixed with this commit: https://github.com/alfredodeza/konira/commit/2d72f7998a69b2a22d4f80b99e59330f64ee07c3

Could you please check out the HEAD of this repository and see if it works for you? Pending your response to close this ticket.

igorgue commented 13 years ago

It works, thanks for fixing it quickly.

alfredodeza commented 13 years ago

The new version with the bug fixes you reported has been pushed to PyPi: http://pypi.python.org/pypi/konira