How to run tests?

106 views
Skip to first unread message

Arve Knudsen

unread,
Jun 9, 2010, 12:31:20 PM6/9/10
to Coverage.py Development
Hi

I have checked out latest coverage.py from bitbucket, and am trying to
run the testsuite (using nosetests), on Windows 7/Python 2.6. I guess
something is wrong with my setup though, since I get 119 errors and 10
failures. Many of the errors are due to being unable to import
covmodzip1. What do I need to do?

Thanks,
Arve

Arve Knudsen

unread,
Jun 9, 2010, 12:55:39 PM6/9/10
to Coverage.py Development
I found that by entering the 'test' directory before running nosetests
helped, but I still get 4 test errors due to not being able to import
covmodzip1.

Arve

Arve Knudsen

unread,
Jun 9, 2010, 2:06:23 PM6/9/10
to Ned Batchelder, coverag...@googlegroups.com
On Wed, Jun 9, 2010 at 7:16 PM, Ned Batchelder <n...@nedbatchelder.com> wrote:
Arve, a quick answer, more later:  at the bottom of howto.txt are brief notes on what needs to be done to run the tests.  The Makefile has a step called testready that will create the egg you need.

I did follow the instructions under the Testing section in howto.txt. That is, I installed a development egg of Coverage.py and created a coverage_test_egg.pth. Running make isn't mentioned.

Now, on my home desktop I get another error when trying to run the tests:

PS C:\Users\Arve\VCSCheckouts\Coverage_py> nosetests -x
C:\Python26\lib\site-packages\nose-0.11.1-py2.6.egg\nose\plugins\base.py:72: RuntimeWarning: Plugin <nose.plugins.cover.
Coverage object at 0x02776170> has conflicting option string: option --with-coverage: conflicting option string(s): --wi
th-coverage and will be disabled
  "be disabled" % (self, e), RuntimeWarning)
Traceback (most recent call last):
  File "C:\Python26\Scripts\nosetests-script.py", line 8, in <module>
    load_entry_point('nose==0.11.1', 'console_scripts', 'nosetests')()
  File "C:\Python26\lib\site-packages\nose-0.11.1-py2.6.egg\nose\core.py", line 113, in __init__
    argv=argv, testRunner=testRunner, testLoader=testLoader)
  File "C:\Python26\lib\unittest.py", line 816, in __init__
    self.parseArgs(argv)
  File "C:\Python26\lib\site-packages\nose-0.11.1-py2.6.egg\nose\core.py", line 130, in parseArgs
    self.config.configure(argv, doc=self.usage())
  File "C:\Python26\lib\site-packages\nose-0.11.1-py2.6.egg\nose\config.py", line 299, in configure
    self.plugins.configure(options, self)
  File "C:\Python26\lib\site-packages\nose-0.11.1-py2.6.egg\nose\plugins\manager.py", line 254, in configure
    cfg(options, config)
  File "C:\Python26\lib\site-packages\nose-0.11.1-py2.6.egg\nose\plugins\manager.py", line 82, in __call__
    return self.call(*arg, **kw)
  File "C:\Python26\lib\site-packages\nose-0.11.1-py2.6.egg\nose\plugins\manager.py", line 150, in simple
    result = meth(*arg, **kw)
  File "C:\Python26\lib\site-packages\nose-0.11.1-py2.6.egg\nose\plugins\cover.py", line 118, in configure
    self.coverErase = options.cover_erase
AttributeError: Values instance has no attribute 'cover_erase'


Arve

Ned Batchelder

unread,
Jun 9, 2010, 1:16:34 PM6/9/10
to coverag...@googlegroups.com, Arve Knudsen
Arve, a quick answer, more later: at the bottom of howto.txt are brief
notes on what needs to be done to run the tests. The Makefile has a
step called testready that will create the egg you need.

--Ned.

On 6/9/2010 12:55 PM, Arve Knudsen wrote:

Ned Batchelder

unread,
Jun 9, 2010, 3:52:46 PM6/9/10
to coverag...@googlegroups.com, Arve Knudsen
Update your nose to 0.11.3.  I understand they only recently got the logic right so that coverage.py's plugin can override theirs.

--Ned.

Arve Knudsen

unread,
Jun 9, 2010, 4:42:45 PM6/9/10
to coverag...@googlegroups.com
On Wed, Jun 9, 2010 at 9:52 PM, Ned Batchelder <n...@nedbatchelder.com> wrote:
Update your nose to 0.11.3.  I understand they only recently got the logic right so that coverage.py's plugin can override theirs.

Thanks, that did the trick.

Arve

Arve Knudsen

unread,
Jun 9, 2010, 4:48:59 PM6/9/10
to Ned Batchelder, coverag...@googlegroups.com
On Wed, Jun 9, 2010 at 7:16 PM, Ned Batchelder <n...@nedbatchelder.com> wrote:
Arve, a quick answer, more later:  at the bottom of howto.txt are brief notes on what needs to be done to run the tests.  The Makefile has a step called testready that will create the egg you need.
 
After reading the Makefile I understood how to create the testdata, and was now more successful. I strongly suggest you document this in your README though, there shouldn't be much to it (make testready; create coverage_test_egg.pth; cd test; nosetests). That being said, one test still fails:

======================================================================
ERROR: Failure: ImportError (No module named py)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python26\lib\site-packages\nose-0.11.3-py2.6.egg\nose\loader.py", line 382, in loadTestsFromName
    addr.filename, addr.module)
  File "C:\Python26\lib\site-packages\nose-0.11.3-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.3-py2.6.egg\nose\importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "C:\Users\Arve\VCSCheckouts\Coverage_py\test\test_testplugin.py", line 3, in <module>
    import py
ImportError: No module named py


Arve

Ned Batchelder

unread,
Jun 9, 2010, 5:11:52 PM6/9/10
to coverag...@googlegroups.com, Arve Knudsen
Yes, I definitely need to improve the docs for developers, you are right.

The py module is due to needing py.test installed to test the py.test plug in, a recent addition to the code base.

--Ned.
Reply all
Reply to author
Forward
0 new messages