我正在尝试将pytest-django添加到我当前的pytest3/Django1.7环境中.
目前我们还没有使用该插件,并且在某些测试之间一直处于共享状态
一切似乎在视觉上看起来很好,测试似乎通过直到最后我收到以下错误消息:
request => @pytest.fixture(autouse=True) def _django_db_marker(request): """Implement the django_db marker, internal to pytest-django. This will dynamically request the ``db`` or ``transactional_db`` fixtures as required by the django_db marker. """ marker = request.keywords.get('django_db', None) if marker: validate_django_db(marker) if marker.transaction: getfixturevalue(request, 'transactional_db') else: getfixturevalue(request, 'db') ve/lib/python2.7/site-packages/pytest_django/plugin.py:376: self = query = 'SELECT "django_migrations"."app", "django_migrations"."name" FROM "django_migrations"', params = () def execute(self, query, params=None): if params is None: return Database.Cursor.execute(self, query) query = self.convert_query(query) > return Database.Cursor.execute(self, query, params) E OperationalError: no such table: django_migrations ve/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py:485: OperationalError
我试图创建表ensure_schema
中conftest.py
.我试过的每个选项--nomigrations
和--create-db
到pytest
.
我猜这是遗留系统的一个奇怪的配置问题,但我不知道从哪里开始寻找.有人有建议吗?