I hav amde this alias : test='python -m nose.core --tests $1 -s --with-coverage'

this runs but gives an OS Error saying:

$ test test_filterList.py
nose.plugins.cover: ERROR: Coverage not available: unable to import coverage module
....E
======================================================================
ERROR: Failure: OSError (No such file /Users/sanjeevkumar/Development/python/-bash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/nose/failure.py", line 41, in runTest
    raise self.exc_class(self.exc_val)
OSError: No such file /Users/sanjeevkumar/Development/python/-bash

----------------------------------------------------------------------
Ran 5 tests in 0.001s

FAILED (errors=1)

any help would be appreciated..

Recommended Answers

All 4 Replies

Did you check that the coverage module is installed ?

$ pydoc coverage

In linux mint, coverage is available via the package python-coverage .

alright that solves the coverage problem, but i am still getting this error

....E
======================================================================
ERROR: Failure: OSError (No such file /Users/userName/Development/python/-s)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/nose/failure.py", line 41, in runTest
    raise self.exc_class(self.exc_val)
OSError: No such file /Users/userName/Development/python/-s

and if I removed -s flag from the alhas then I get this error

....E
======================================================================
ERROR: Failure: OSError (No such file /Users/sanjeevkumar/--with-coverage)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/nose/failure.py", line 41, in runTest
    raise self.exc_class(self.exc_val)
OSError: No such file /Users/sanjeevkumar/--with-coverage

----------------------------------------------------------------------
Ran 5 tests in 0.002s

seems like I have to do something on the alias ?

Did you try with the options before the file argument ?

python -m nose.core --tests -s --with-coverage $1

alright got it working just changed my alias to test='python -m nose.core -s --with-coverage --tests $1'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.