<div class="gmail_quote">On Fri, Sep 24, 2010 at 7:37 PM, jason pellerin <span dir="ltr"><<a href="mailto:jpellerin@gmail.com">jpellerin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
This is probably a packaging error. It works for me in a virtualenv,<br>
with nose2 installed via 'python setup.py develop' on ubuntu lucid,<br>
python 2.6.5. So if you installed via 'python setup.py install'<br>
because of my poor directions, try 'develop' instead. If that doesn't<br>
work it may be a platform problem.<br></blockquote><div><br></div><div>Thanks for that suggestion, 'develop' worked well. Now that the nose2 command works, I get an error in one of your tests (running nose2 in the project root):</div>
<div><br></div><div><div>..F..</div><div>======================================================================</div><div>FAIL: test_layout2 (nose2.tests.test_logcapture_plugin.LogCaptureFunctionalTest)</div><div>----------------------------------------------------------------------</div>
<div>Traceback (most recent call last):</div><div> File "c:\users\arve\projects\nose2\nose2\tests\test_logcapture_plugin.py", line 17, in test_layout2</div><div> stderr=match)</div><div> File "c:\users\arve\projects\nose2\nose2\tests\__init__.py", line 19, in assertTestRunOutputMatches</div>
<div> self.assertRegexpMatches(cmd_stderr, stderr)</div><div>AssertionError: Regexp didn't match: '>> begin captured logging <<' not found in 'F.F\r\n===============================</div><div>
=======================================\r\nFAIL: test_fail2 (tests.Tests)\r\n-------------------------------------------</div><div>---------------------------\r\nTraceback (most recent call last):\r\n File "c:\\users\\arve\\projects\\nose2\\support\\</div>
<div>layout2\\tests.py", line 23, in test_fail2\r\n self.assertEqual(get_one(), 4)\r\nAssertionError: 1 != 4\r\n\r\n======</div><div>================================================================\r\nFAIL: unittest2.case.FunctionTestCase (test_fail)\r\</div>
<div>n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File</div><div>"c:\\users\\arve\\projects\\nose2\\support\\layout2\\tests.py", line 17, in test_fail\r\n assert get_one() == 2\r\nAs</div>
<div>sertionError\r\n\r\n----------------------------------------------------------------------\r\nRan 3 tests in 0.037s\r\n\</div><div>r\nFAILED (failures=2)\r\n'</div><div><br></div><div>----------------------------------------------------------------------</div>
<div>Ran 5 tests in 0.199s</div><div><br></div><div>FAILED (failures=1)</div></div><div><br></div><div><br></div><div>Arve</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div class="h5">
On Fri, Sep 24, 2010 at 12:36 PM, Arve Knudsen <<a href="mailto:arve.knudsen@gmail.com">arve.knudsen@gmail.com</a>> wrote:<br>
> I'm using Python 2.6 on Windows 7. I've installed unittest2 branch plugins<br>
> and Nose2 branch default. The 'nose2' command fails however, like so:<br>
> Traceback (most recent call last):<br>
> File "C:\Python26\Scripts\nose2-script.py", line 8, in <module><br>
> load_entry_point('nose2==0.1', 'console_scripts', 'nose2')()<br>
> File "C:\Python26\lib\site-packages\pkg_resources.py", line 318, in<br>
> load_entry_point<br>
> return get_distribution(dist).load_entry_point(group, name)<br>
> File "C:\Python26\lib\site-packages\pkg_resources.py", line 2221, in<br>
> load_entry_point<br>
> return ep.load()<br>
> File "C:\Python26\lib\site-packages\pkg_resources.py", line 1954, in load<br>
> entry = __import__(self.module_name, globals(),globals(), ['__name__'])<br>
> ImportError: No module named nose2<br>
><br>
> Before that, I tried 'python setup.py nosetests'. This fails like so<br>
> (excerpt):<br>
> ======================================================================<br>
> ERROR: Failure: AttributeError ('NoneType' object has no attribute<br>
> 'setdefault')<br>
> ----------------------------------------------------------------------<br>
> Traceback (most recent call last):<br>
> File<br>
> "C:\Python26\lib\site-packages\nose-0.11.4.dev-py2.6.egg\nose\loader.py",<br>
> line 382, in loadTestsFromName<br>
> addr.filename, addr.module)<br>
> File<br>
> "C:\Python26\lib\site-packages\nose-0.11.4.dev-py2.6.egg\nose\importer.py",<br>
> line 39, in importFromPath<br>
> return self.importFromDir(dir_path, fqname)<br>
> File<br>
> "C:\Python26\lib\site-packages\nose-0.11.4.dev-py2.6.egg\nose\importer.py",<br>
> line 86, in importFromDir<br>
> mod = load_module(part_fqname, fh, filename, desc)<br>
> File "C:\Users\Arve\Projects\Nose2\nose2\plugins\testid.py", line 7, in<br>
> <module><br>
> class TestId(Plugin):<br>
> File<br>
> "C:\Python26\lib\site-packages\unittest2-0.6.0.alpha._plugins.branch_-py2.6.egg\unittest2\events.py",<br>
> line 336, i<br>
> n __new__<br>
> cls()<br>
> File<br>
> "C:\Python26\lib\site-packages\unittest2-0.6.0.alpha._plugins.branch_-py2.6.egg\unittest2\events.py",<br>
> line 361, i<br>
> n __new__<br>
> instance.config = getConfig(configSection)<br>
> File<br>
> "C:\Python26\lib\site-packages\unittest2-0.6.0.alpha._plugins.branch_-py2.6.egg\unittest2\config.py",<br>
> line 28, in<br>
> getConfig<br>
> return _config.setdefault(section, Section(section))<br>
> AttributeError: 'NoneType' object has no attribute 'setdefault'<br>
><br>
> Arve<br>
> On Fri, Sep 24, 2010 at 6:26 PM, jason pellerin <<a href="mailto:jpellerin@gmail.com">jpellerin@gmail.com</a>> wrote:<br>
>><br>
>> Good question! :)<br>
>><br>
>> You'll need the plugins branch of unittest2 from<br>
>> <a href="http://hg.python.org/unittest2" target="_blank">http://hg.python.org/unittest2</a>. With that and nose2 installed (in a<br>
>> virtualenv is fine) then you can run nose2's tests by running 'nose2'<br>
>> (w/o quotes) from the command line.<br>
>><br>
>> To restrict to unit tests, run nose2 -A tags=unit. To restrict to<br>
>> functional tests, run nose2 -A tags=functional. (There is currently<br>
>> only one functional test and it fails.) Tests are in the nose2/tests<br>
>> package and should be self-explanatory, I hope.<br>
>><br>
>> To play around with test runs, try running nose2 in support/layout1<br>
>> and support/layout2.<br>
>><br>
>> As of this moment nose2 requires python 2.6, but I'm about to merge a<br>
>> fork that makes it compatible with 2.4-2.6. I haven't tested yet with<br>
>> 2.7, and python3 support is not in yet (issue 16 in the tracker).<br>
>><br>
>> JP<br>
>><br>
>> On Fri, Sep 24, 2010 at 12:17 PM, Arve Knudsen <<a href="mailto:arve.knudsen@gmail.com">arve.knudsen@gmail.com</a>><br>
>> wrote:<br>
>> > Hi Jason<br>
>> > How should one run Nose2's unittests?<br>
>> > Arve<br>
>> ><br>
>> > On Fri, Sep 24, 2010 at 4:25 PM, jason pellerin <<a href="mailto:jpellerin@gmail.com">jpellerin@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> There are roughly 15 open tickets between here and nose2 0.1.<br>
>> >><br>
>> >> <a href="https://bitbucket.org/jpellerin/nose2/issues?status=new&status=open" target="_blank">https://bitbucket.org/jpellerin/nose2/issues?status=new&status=open</a><br>
>> >><br>
>> >> Who wants to f1rst p0st the AUTHORS file?<br>
>> >><br>
>> >> JP<br>
>> >><br>
>> >> _______________________________________________<br>
>> >> testing-in-python mailing list<br>
>> >> <a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
>> >> <a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br>