Skip to content Skip to sidebar Skip to footer

Asserts In Python 2.7 Not Working For Me Example Assertin

I have python 2.7 installed on my Mac. (verified by running python -v in terminal) When I try to use any of the new 2.7 assert methods I get AtributeError. I have looked at http:

Solution 1:

I suspect that your code is not running in the version of Python that you think it is. If you add the following test case:

deftest_python_version(self):
    import sys
    assert sys.version_info[0:3] >= (2,7,0)

If that test case fails, then you're not running on a version of Python new enough to contain self.assertIn().

Post a Comment for "Asserts In Python 2.7 Not Working For Me Example Assertin"