Skip to content

InternalError and AssertionError with non-django tests #190

Closed
@klvbdmh

Description

@klvbdmh

After installing pytest-django I cannot run my old tests on a simple scrapper. The scrapper's project consists of five files: __init__.py, scrap.py, test_scrap.py, output.txt, and test.txt. The test works by comparing the two text files. As you can see it's a very simple project and it doesn't use django at all.

When I run test_scrap.py with pytest I get the following error:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "C:\Python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\main.py", line 80, in wrap_session
INTERNALERROR>     config.do_configure()
INTERNALERROR>   File "C:\Python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\config.py", line 618, in do_configure
INTERNALERROR>     self.hook.pytest_configure(config=self)
INTERNALERROR>   File "C:\Python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 413, in __call__
INTERNALERROR>     return self._docall(methods, kwargs)
INTERNALERROR>   File "C:\Python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 424, in _docall
INTERNALERROR>     res = mc.execute()
INTERNALERROR>   File "C:\Python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 315, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "C:\Python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\pastebin.py", line 14, in pytest_configure
INTERNALERROR>     __multicall__.execute()
INTERNALERROR>   File "C:\Python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 315, in execute
INTERNALERROR>     res = method(**kwargs)
INTERNALERROR>   File "C:\Python\lib\site-packages\pytest_django-2.7.0-py3.4.egg\pytest_django\plugin.py", line 203, in
pytest_configure
INTERNALERROR>     if django_settings_is_configured():
INTERNALERROR>   File "C:\Python\lib\site-packages\pytest_django-2.7.0-py3.4.egg\pytest_django\lazy_django.py", line 26,
 in django_settings_is_configured
INTERNALERROR>     assert settings.configured is True
INTERNALERROR> AssertionError: assert <django.conf.LazySettings object at 0x0361D930>.configured is True

Tests in a separate django project work with no problems after following the configuration procedure. It's just non-django projects I have problems with.

I'm using the latest stable versions of both pytest and pytest-django, Python 3.4, and Windows 7.

After uninstalling pytest-django plugin my non-django scrapper test works again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions