When I run my unit test I get this error:
FAIL: test_syntax (mezzanine.core.tests.Tests)
Traceback (most recent call last):
File “/Users/taylor/aco/lib/python2.7/site-packages/mezzanine/core/tests.py”, line 459, in test_syntax
self.fail(“Syntax warnings!\n\n%s” % “\n”.join(warnings))
AssertionError: Syntax warnings!mezzanine/core/models.py:340: list comprehension redefines ‘name’ from line 331
This is the only error I get when I run my unit tests and I have searched everywhere to figure out how to fix this error but I have found nothing useful.
Can someone please explain to me what is going on here and how I can fix it?
I presume you are running Mezzanine 1.3.0, the current stable release. The current master branch in github does not have this issue. I just installed performed the following:
For what it is worth, the
test_syntaxmethod that is failing in 1.3.0 runs tests with the pyflakes.Checker and pep8 Python modules. The filemezzanine/core/models.pyhad (has?) syntax errors. A brief scan of the commits indicates thattest_syntaxhas not changed. The specific syntax that was giving the error is inmezzanine.core.models.Orderable‘s with_respect_to method, which doesn’t have any PEP8 nor pyflakes errors. When I run pyflakes against the 1.3.0 version ofmezzanine.core.models: