New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrations in django-taggit don't work when SOUTH_TESTS_MIGRATE = True (triggered by python_files=*.py) #158
Comments
Thanks for your report! I have looked into it, but can only provide more information for the moment. When adding some print statements, it appears that South calls
(I have changed the order of The odd thing is:
I have noticed that I've only skimmed the documentation for FWIW, I have tested it with pytest-master also, and used Python 2.7.8 in general (there were compatibility problems with python-3.4). |
Out of curiosity: It seems that you run tests from |
FWIW, I am also using django-taggit in my own project, and it does not trigger this issue. I have just tried |
It is caused by Commenting that line and moving Although
(same with pytest-2.6.1, just also tested it with 2.5) |
So the problem is that the same file gets imported twice from different locations? Is there anything we can do to prevent that? The original issue seems to have been resolved by changing pytyhon_files. |
@pelme I think it's some bad interaction between pytest magic and South magic probably, nothing pytest-django could do about probably. |
I think it might be made easier for newcomers through slightly different documentation. If python_files=*.py, breaks south migrations, then this FAQ: http://pytest-django.readthedocs.org/en/latest/faq.html#my-tests-are-not-being-found-why-not |
This is meant to reproduce/test pytest-dev#158, but does not cause a failure.
This is meant to reproduce/test pytest-dev#158, but does not cause a failure.
This is meant to reproduce/test pytest-dev#158, but does not cause a failure.
@gandalfar |
I've found a way to reproduce it in a test. The problem is triggered by also using django-taggit: blueyed@5ce816a The bug is with pytest though, where the PEP 302 importer module breaks I've submitted a PR for pytest at: https://bitbucket.org/pytest-dev/pytest/pull-request/259/fix-reload-for-files-matched-by. I am closing the issue for pytest-django. |
This is meant to reproduce/test pytest-dev#158, but does not cause a failure.
This is meant to reproduce/test pytest-dev/pytest-django#158, but does not cause a failure.
Fix for issue #128 introduced ability for SOUTH_TESTS_MIGRATE = True, to correctly run south migrations. In this specific case I want to run migrations since it provides data migration for data that I want to use in tests.
I'm trying to integrate it into one my projects that is using
django-taggit
and it crashes with strange south error:I'm not sure if it's a problem in
pytest_django
ordjango-taggit
, but my hunch is that you'll probably understand better what's going on with south mocking.to make it easier to test, I've also created a GitHub repo: https://github.com/gandalfar/pytest-example
that is currently using f10e48d
The text was updated successfully, but these errors were encountered: