From a309443909310ac2a721093451e8b71799b86ef8 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 30 Sep 2014 23:14:24 +0200 Subject: [PATCH] Add test_south_migrations_python_files_star This is meant to reproduce/test https://github.com/pytest-dev/pytest-django/issues/158, but does not cause a failure. --- tests/test_db_setup.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/test_db_setup.py b/tests/test_db_setup.py index 1844539bb..c9c83f6b7 100644 --- a/tests/test_db_setup.py +++ b/tests/test_db_setup.py @@ -323,3 +323,36 @@ def test_inner_south(): result = testdir.runpytest('--tb=short', '-v', '-s') result.stdout.fnmatch_lines(['*test_inner_south*PASSED*']) + + @pytest.mark.django_project(extra_settings=""" + INSTALLED_APPS += [ 'south', ] + SOUTH_TESTS_MIGRATE = True + SOUTH_MIGRATION_MODULES = { + 'app': 'tpkg.app.south_migrations', + } + """) + def test_south_migrations_python_files_star(self, django_testdir_initial): + """ + Test for South migrations and tests imported via `*.py`. + + This is meant to reproduce + https://github.com/pytest-dev/pytest-django/issues/158, but does not + fail. + """ + testdir = django_testdir_initial + testdir.create_test_module(''' + import pytest + + @pytest.mark.django_db + def test_inner_south(): + pass + ''', 'test.py') + testdir.create_initial_south_migration() + + pytest_ini = testdir.create_test_module(""" + [pytest] + python_files=*.py""", 'pytest.ini') + + result = testdir.runpytest('--tb=short', '-v', '-s', '-c', pytest_ini) + result.stdout.fnmatch_lines(['*test_inner_south*PASSED*']) + result.stdout.fnmatch_lines(['*mark_south_migration_forwards*'])