Skip to content

Commit

Permalink
Add test_south_migrations_python_files_star
Browse files Browse the repository at this point in the history
This is meant to reproduce/test
pytest-dev#158, but does not
cause a failure.
  • Loading branch information
blueyed committed Sep 30, 2014
1 parent f7fb93f commit a309443
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/test_db_setup.py
Expand Up @@ -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*'])

0 comments on commit a309443

Please sign in to comment.