nose

django-nose testrunner doesn't use --with-django option

When running nosetests, django-nose runner doesn't supply --with-django option to nosetests, so my nose + Twill tests fail when trying to access URLs: ./manage.py test ... raise BrowserStateError("cannot go to '%s'" % (url,)) BrowserStateError: cannot go to 'http://127.0.0.1:8088/admin/' -------------------------------------------------...

Buildout + Nose failing with passed options options

After running a buildout operation on my project, I can run nose with the following command: # ./bin/nosetests ---------------------------------------------------------------------- Ran 0 tests in 0.310s However, when I try to pass options (such as -w for the base directory, I get the following: # ./bin/nosetests -vv --detailed-erro...

How do I prevent Nose from running and reporting duplicate tests?

I'm using django-nose to test our Django projects. It is common to split large test suites inside an application in Django like this: myapp/ __init__.py models.py tests/ __init__.py test_views.py test_models.py views.py tests/__init__.py would look like this: from test_views import * from test_models import * Si...

Nose / Nosegae: Import problems

Hello, I have this problem and it's drivin' me nuts! So I am developing my first real Google App Engine application and I always like to discover things while writing tests. So I have the following setup: I have a virtualenv with nose, nosegae, webtest and gaetestbed. It's called porksvr. I activate my virtualenv like this: source ...

Check that a function raises a warning with nose tests

I'm writing unit tests using nose, and I'd like to check whether a function raises a warning (the function uses warnings.warn). Is this something that can easily be done? ...

Python unit testing: make nose show failed assertions values.

Hello, is it possible to show the assertion values that failed? It shows the traceback and what kind of exception was throw but it would more practical to know which values failed. Example: assert result.file == file AssertionError ...

How to make py.test or nose to look for tests inside all python files?

I do have several small modules where the tests are inside them and py.test or nose does not look for them because they do not contain test in their filename. How can I convince py.test or nose to look for tests inside all python files, recursively - '''including the ones that do not have test in their filenames'''? Inside the source f...

How do I run a single test with Nose in Pylons

I have a Pylons 1.0 app with a bunch of tests in the test/functional directory. I'm getting weird test results and I want to just run a single test. The nose documentation says I should be able to pass in a test name at the command line but I get ImportErrors no matter what I do For example: nosetests -x -s sometestname Gives: Trac...

How to change the message in a Python AssertionError?

I'm writing per the following, in which I try to produce a decent error message when comparing two multiline blocks of Unicode text. The interior method that does the comparison raises an assertion, but the default explanation is useless to me I need to add something to code such as this below: def assert_long_strings_equal(one, other)...

python nose and twisted

I am writing a test for a function that downloads the data from an url with Twisted (I know about twisted.web.client.getPage, but this one adds some extra functionality). Either ways, I want to use nosetests since I am using it throughout the project and it doesn't look appropriate to use Twisted Trial only for this particular test. So w...

why python nose unittest teardown fixture failed

Hi, I'm using nose test framework. When running a test module, the teardown function defined in it failed. the error raised says the fixture is locked by another process. here is my test module, test_my_module.py: ... ... def teardown(): if os.path.exists(test_output_dir): shutil.rmtree(test_output_dir) ... ... @with_s...

How do you run nosetest from pycharm?

How do you execute nosetest from pycharm to run all unit tests? I know that pycharm supports python's unittest and py.test and that they will properly support nosetests in pycharm 1.1 but I was wondering if there was a work around. ...

python nose framework: A plugin to display results in a human friendly format

Any format which is targeted for humans (.html, .doc, whatever) would be good. I cannot find any plugin that provides it All I found was XUNIT or XML output.. ...

Why can't nosetests find one the elements in sys.path?

I have a series of unit tests that I'm running with nose. For some of my tests, I'd like to remove a module's path from the sys.path so there is no conflict with what I am testing. sys.path.remove('/path/to/remove/from/sys/path') If I run the Python interpreter and call sys.path, the '/path/to/remove/from/sys/path' is there in the li...

South django.db.utils.IntegrityError: django_content_type.name may not be NULL while running unit tests

I'm getting this error django.db.utils.IntegrityError: django_content_type.name may not be NULL while running tests via nosetest. I've done everything as told in south tutorial - initial migration, fake migration etc. Running site normally via runserver command works like charm, but while using test command - above error. Also, In my d...