Raising Python _ExpectedFailure for unittests with @ unittest.expectedFailure

I have two systems that run the same Django unittests suite. Some tests use the @unittest.expectedFailure decorator.

On one system, they work fine and report OK (expected failures=10, unexpected successes=2) at the end of the test run OK (expected failures=10, unexpected successes=2) .

On another system, the same test errors, but raise _ExpectedFailure and _UnexpectedSuccess without tracking.

Has anyone seen this behavior before? Is this a configuration problem? Both systems run Python 2.7, Django 1.3, and install unittest and unittest2.

+3
source share
1 answer

I have a problem and I got it to work by removing / usr / local / lib / python 2.7 and then reinstalling everything from scratch.

The reason for this, I believe that python may not have cleared its python object and cache files (* .pyc, * .pyo) from its working directory. That is, this is not the directory of your project, but the source code of python.

Not sure what it is, but it worked for me!

+1
source

Source: https://habr.com/ru/post/903701/


All Articles