[open-science-dev] Running PyBossa tests
Daniel Lombraña González
teleyinex at gmail.com
Mon Sep 23 08:53:38 UTC 2013
Hi Traian,
I don't know what could be not working for you, as I've just tested
everything with vagrant, which means that I've set up a fully new and clean
environment out of the box for doing the tests, and all of them got passed.
The error that you are getting looks like your environment is not finding
Flask, so you need to be sure that you have installed nose and flask in the
same environment and that you have enabled it. Can you try vagrant in your
machine? The docs are here:
http://docs.pybossa.com/en/latest/vagrant_pybossa.html
Cheers,
Daniel
On Wed, Sep 18, 2013 at 3:13 PM, Traian Fratean <ftraian at gmail.com> wrote:
> I am running ina virtualenv. I installed nose and mock in the virtualenv
> and get the same error:
>
> (PYBOSSA)ftraian> nosetests -v test/
> Failure: ImportError (No module named flask) ... ERROR
> Failure: ImportError (No module named flask) ... ERROR
> Failure: ImportError (No module named flask) ... ERROR
> Failure: ImportError (No module named mock) ... ERROR
> Failure: ImportError (No module named flask) ... ERROR
> Failure: ImportError (No module named flask) ... ERROR
> Failure: ImportError (No module named flask) ... ERROR
> Failure: ImportError (No module named bs4) ... ERROR
> Failure: ImportError (No module named flask) ... ERROR
> Failure: ImportError (No module named flask) ... ERROR
> Failure: ImportError (No module named flask) ... ERROR
> Failure: ImportError (No module named flask) ... ERROR
> .......
> ======================================================================
> ERROR: Failure: ImportError (No module named flask)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 413,
> in loadTestsFromName
> addr.filename, addr.module)
> File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 47,
> in importFromPath
> return self.importFromDir(dir_path, fqname)
> File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 94,
> in importFromDir
> mod = load_module(part_fqname, fh, filename, desc)
> File "/home/ftraian/codebase/pybossa/project/test/test_web.py", line 4,
> in <module>
> from helper import web
> File "/home/ftraian/codebase/pybossa/project/test/helper/web.py", line
> 1, in <module>
> from base import model, db, web, Fixtures
> File "/home/ftraian/codebase/pybossa/project/test/base.py", line 4, in
> <module>
> import pybossa.web as web
> File "/home/ftraian/codebase/pybossa/project/pybossa/web.py", line 21,
> in <module>
> from flask import Response, request, g, render_template,\
> ImportError: No module named flask
>
> ----------------------------------------------------------------------
> Ran 12 tests in 0.018s
>
> FAILED (errors=12)
>
>
>
>
> Sorry for replying late.
>
>
> 2013/9/10 Daniel Lombraña González <teleyinex at gmail.com>
>
>> Hi Traian,
>>
>> It's strange if you have installed in your system. Can you try to create
>> a virtual environment and install all the required libraries there plus
>> nose and mock? I'll add a requirements_unit_tests.txt to add them there.
>>
>> Please, let me know if this works.
>>
>> Cheers,
>>
>> Daniel
>>
>>
>> On Tue, Sep 10, 2013 at 6:21 AM, Traian Fratean <ftraian at gmail.com>wrote:
>>
>>> Hello,
>>>
>>> I installed PyBossa locally and want to run tests. When running I get
>>> this error, though I have Flask:
>>>
>>>
>>>
>>> ======================================================================
>>> ERROR: Failure: ImportError (No module named flask)
>>> ----------------------------------------------------------------------
>>> Traceback (most recent call last):
>>> File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line
>>> 413, in loadTestsFromName
>>> addr.filename, addr.module)
>>> File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line
>>> 47, in importFromPath
>>> return self.importFromDir(dir_path, fqname)
>>> File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line
>>> 94, in importFromDir
>>> mod = load_module(part_fqname, fh, filename, desc)
>>> File "/home/ftraian/codebase/pybossa/pybossa/test/test_web.py", line
>>> 4, in <module>
>>> from helper import web
>>> File "/home/ftraian/codebase/pybossa/pybossa/test/helper/web.py", line
>>> 1, in <module>
>>> from base import model, db, web, Fixtures
>>> File "/home/ftraian/codebase/pybossa/pybossa/test/base.py", line 4, in
>>> <module>
>>> import pybossa.web as web
>>> File "/home/ftraian/codebase/pybossa/pybossa/pybossa/web.py", line 21,
>>> in <module>
>>> from flask import Response, request, g, render_template,\
>>> ImportError: No module named flask
>>>
>>> ----------------------------------------------------------------------
>>> Ran 13 tests in 0.022s
>>>
>>> FAILED (errors=13)
>>> (PYBOSSA)ftraian>
>>> (PYBOSSA)ftraian> pip install flask
>>> Requirement already satisfied (use --upgrade to upgrade): flask in
>>> /home/ftraian/codebase/pybossa/runtime/PYBOSSA/lib/python2.7/site-packages
>>> Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7
>>> in
>>> /home/ftraian/codebase/pybossa/runtime/PYBOSSA/lib/python2.7/site-packages
>>> (from flask)
>>> Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in
>>> /home/ftraian/codebase/pybossa/runtime/PYBOSSA/lib/python2.7/site-packages
>>> (from flask)
>>> Requirement already satisfied (use --upgrade to upgrade):
>>> itsdangerous>=0.21 in
>>> /home/ftraian/codebase/pybossa/runtime/PYBOSSA/lib/python2.7/site-packages
>>> (from flask)
>>> Requirement already satisfied (use --upgrade to upgrade): markupsafe in
>>> /home/ftraian/codebase/pybossa/runtime/PYBOSSA/lib/python2.7/site-packages
>>> (from Jinja2>=2.4->flask)
>>> Cleaning up...
>>>
>>>
>>>
>>>
>>> Thank you,
>>> Traian.
>>>
>>> _______________________________________________
>>> open-science-dev mailing list
>>> open-science-dev at lists.okfn.org
>>> http://lists.okfn.org/mailman/listinfo/open-science-dev
>>> Unsubscribe: http://lists.okfn.org/mailman/options/open-science-dev
>>>
>>>
>>
>>
>> --
>>
>> ··························································································································································
>> http://daniellombrana.es
>> http://citizencyberscience.net
>> http://www.shuttleworthfoundation.org/fellows/daniel-lombrana/
>>
>> ··························································································································································
>> Por favor, NO utilice formatos de archivo propietarios para el
>> intercambio de documentos, como DOC y XLS, sino PDF, HTML, RTF, TXT, CSV
>> o cualquier otro que no obligue a utilizar un programa de un
>> fabricante concreto para tratar la información contenida en él.
>>
>> ··························································································································································
>>
>
>
--
http://daniellombrana.es
http://citizencyberscience.net
http://www.shuttleworthfoundation.org/fellows/daniel-lombrana/
··························································································································································
Please do NOT use proprietary file formats to share files
like DOC or XLS, instead use PDF, HTML, RTF, TXT, CSV or
any other format that does not impose on the user the employment
of any specific software to work with the information inside the files.
··························································································································································
Por favor, NO utilice formatos de archivo propietarios para el
intercambio de documentos, como DOC y XLS, sino PDF, HTML, RTF, TXT, CSV
o cualquier otro que no obligue a utilizar un programa de un
fabricante concreto para tratar la información contenida en él.
··························································································································································
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/open-science-dev/attachments/20130923/45ae95f0/attachment.html>
More information about the open-science-dev
mailing list