[TIP] nose2: the begging continues

jason pellerin jpellerin at gmail.com
Fri Sep 24 11:13:46 PDT 2010


Great, glad it's working. That's a known failing test, demonstrating
that it's not currently possible (or at least I don't know how) to
attach extra info to error reports.

In general I would not expect nose2's test suite to be passing all the
time until at least unittest2's plugins branch has a public release,
since we'll sometimes want to check in failing tests that illustrate
an issue or a bug.

JP

On Fri, Sep 24, 2010 at 2:07 PM, Arve Knudsen <arve.knudsen at gmail.com> wrote:
> On Fri, Sep 24, 2010 at 7:37 PM, jason pellerin <jpellerin at gmail.com> wrote:
>>
>> 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.
>
> 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):
> ..F..
> ======================================================================
> FAIL: test_layout2
> (nose2.tests.test_logcapture_plugin.LogCaptureFunctionalTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "c:\users\arve\projects\nose2\nose2\tests\test_logcapture_plugin.py",
> line 17, in test_layout2
>     stderr=match)
>   File "c:\users\arve\projects\nose2\nose2\tests\__init__.py", line 19, in
> assertTestRunOutputMatches
>     self.assertRegexpMatches(cmd_stderr, stderr)
> AssertionError: Regexp didn't match: '>> begin captured logging <<' not
> found in 'F.F\r\n===============================
> =======================================\r\nFAIL: test_fail2
> (tests.Tests)\r\n-------------------------------------------
> ---------------------------\r\nTraceback (most recent call last):\r\n  File
> "c:\\users\\arve\\projects\\nose2\\support\\
> layout2\\tests.py", line 23, in test_fail2\r\n
>  self.assertEqual(get_one(), 4)\r\nAssertionError: 1 != 4\r\n\r\n======
> ================================================================\r\nFAIL:
> unittest2.case.FunctionTestCase (test_fail)\r\
> n----------------------------------------------------------------------\r\nTraceback
> (most recent call last):\r\n  File
> "c:\\users\\arve\\projects\\nose2\\support\\layout2\\tests.py", line 17, in
> test_fail\r\n    assert get_one() == 2\r\nAs
> sertionError\r\n\r\n----------------------------------------------------------------------\r\nRan
> 3 tests in 0.037s\r\n\
> r\nFAILED (failures=2)\r\n'
> ----------------------------------------------------------------------
> Ran 5 tests in 0.199s
> FAILED (failures=1)
>
> Arve
>
>>
>> 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