[TIP] nose2: the begging continues

jason pellerin jpellerin at gmail.com
Fri Sep 24 10:37:36 PDT 2010


This is probably a packaging error. It works for me in a virtualenv,
with nose2 installed via 'python setup.py develop' on ubuntu lucid,
python 2.6.5. So if you installed via 'python setup.py install'
because of my poor directions, try 'develop' instead. If that doesn't
work it may be a platform problem.

BTW, there's no 'nosetests' command defined by nose2 -- probably won't
ever be, since now the test command in setuptools/distribute lets
projects specify a test runner.

JP

On Fri, Sep 24, 2010 at 12:36 PM, Arve Knudsen <arve.knudsen at gmail.com> wrote:
> I'm using Python 2.6 on Windows 7. I've installed unittest2 branch plugins
> and Nose2 branch default. The 'nose2' command fails however, like so:
> Traceback (most recent call last):
>   File "C:\Python26\Scripts\nose2-script.py", line 8, in <module>
>     load_entry_point('nose2==0.1', 'console_scripts', 'nose2')()
>   File "C:\Python26\lib\site-packages\pkg_resources.py", line 318, in
> load_entry_point
>     return get_distribution(dist).load_entry_point(group, name)
>   File "C:\Python26\lib\site-packages\pkg_resources.py", line 2221, in
> load_entry_point
>     return ep.load()
>   File "C:\Python26\lib\site-packages\pkg_resources.py", line 1954, in load
>     entry = __import__(self.module_name, globals(),globals(), ['__name__'])
> ImportError: No module named nose2
>
> Before that, I tried 'python setup.py nosetests'. This fails like so
> (excerpt):
> ======================================================================
> ERROR: Failure: AttributeError ('NoneType' object has no attribute
> 'setdefault')
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "C:\Python26\lib\site-packages\nose-0.11.4.dev-py2.6.egg\nose\loader.py",
> line 382, in loadTestsFromName
>     addr.filename, addr.module)
>   File
> "C:\Python26\lib\site-packages\nose-0.11.4.dev-py2.6.egg\nose\importer.py",
> line 39, in importFromPath
>     return self.importFromDir(dir_path, fqname)
>   File
> "C:\Python26\lib\site-packages\nose-0.11.4.dev-py2.6.egg\nose\importer.py",
> line 86, in importFromDir
>     mod = load_module(part_fqname, fh, filename, desc)
>   File "C:\Users\Arve\Projects\Nose2\nose2\plugins\testid.py", line 7, in
> <module>
>     class TestId(Plugin):
>   File
> "C:\Python26\lib\site-packages\unittest2-0.6.0.alpha._plugins.branch_-py2.6.egg\unittest2\events.py",
> line 336, i
> n __new__
>     cls()
>   File
> "C:\Python26\lib\site-packages\unittest2-0.6.0.alpha._plugins.branch_-py2.6.egg\unittest2\events.py",
> line 361, i
> n __new__
>     instance.config = getConfig(configSection)
>   File
> "C:\Python26\lib\site-packages\unittest2-0.6.0.alpha._plugins.branch_-py2.6.egg\unittest2\config.py",
> line 28, in
>  getConfig
>     return _config.setdefault(section, Section(section))
> AttributeError: 'NoneType' object has no attribute 'setdefault'
>
> Arve
> On Fri, Sep 24, 2010 at 6:26 PM, jason pellerin <jpellerin at gmail.com> wrote:
>>
>> Good question! :)
>>
>> You'll need the plugins branch of unittest2 from
>> http://hg.python.org/unittest2. With that and nose2 installed (in a
>> virtualenv is fine) then you can run nose2's tests by running 'nose2'
>> (w/o quotes) from the command line.
>>
>> To restrict to unit tests, run nose2 -A tags=unit. To restrict to
>> functional tests, run nose2 -A tags=functional. (There is currently
>> only one functional test and it fails.) Tests are in the nose2/tests
>> package and should be self-explanatory, I hope.
>>
>> To play around with test runs, try running nose2 in support/layout1
>> and support/layout2.
>>
>> As of this moment nose2 requires python 2.6, but I'm about to merge a
>> fork that makes it compatible with 2.4-2.6. I haven't tested yet with
>> 2.7, and python3 support is not in yet (issue 16 in the tracker).
>>
>> JP
>>
>> On Fri, Sep 24, 2010 at 12:17 PM, Arve Knudsen <arve.knudsen at gmail.com>
>> wrote:
>> > Hi Jason
>> > How should one run Nose2's unittests?
>> > Arve
>> >
>> > On Fri, Sep 24, 2010 at 4:25 PM, jason pellerin <jpellerin at gmail.com>
>> > wrote:
>> >>
>> >> There are roughly 15 open tickets between here and nose2 0.1.
>> >>
>> >> https://bitbucket.org/jpellerin/nose2/issues?status=new&status=open
>> >>
>> >> Who wants to f1rst p0st the AUTHORS file?
>> >>
>> >> JP
>> >>
>> >> _______________________________________________
>> >> testing-in-python mailing list
>> >> testing-in-python at lists.idyll.org
>> >> http://lists.idyll.org/listinfo/testing-in-python
>> >
>> >
>
>



More information about the testing-in-python mailing list