Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

I'm trying to setup pytest and module name not being recognized

$
0
0

I'm trying to configure pytest for the first time.

When I run the command:

python -m pytest

I get the following error:

ImportError: No module named 'Socialmedia.settings.local'; 'Socialmedia.settings' is not a packagepytest-django found a Django project in C:\Users\Alon\PycharmProjects\Socialmedia (it contains manage.py) and added it to the Python path.If this is wrong, add "django_find_project = false" to pytest.ini and explicitly manage your Python path.

pytest file:

[pytest]DJANGO_SETTINGS_MODULE = Socialmedia.settings.localpython_files = test_*.py

Looks like the error is caused due to socialmedia not being recognized.

I tried:

Changing init file and adding the module there.

import Socialmediafrom Socialmedia import settings__all__ = [Socialmedia, settings]

Moving to another directory from the project to the app.

the following picture shows how it looks like

Any idea how to make socialmedia accessible in this file?


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>