Opened 7 years ago

Closed 7 years ago

#29003 closed Bug (invalid)

Errror in "Contributing > Writing Code > Unit tests > Quick start"

Reported by: Дилян Палаузов Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/ says

Quickstart

$ git clone git@github.com:YourGitHubName/django.git django-repo
$ cd django-repo/tests
$ pip install -e ..
$ pip install -r requirements/py3.txt
$ ./runtests.py

which does not work, when Django is not installed (in the virtual environment). Once we are in the tests directory (or call tests/runtests.py) os.sys.path does not contain the parent directory, so this happens:

Traceback (most recent call last):
  File "./runtests.py", line 14, in <module>
    import django
ImportError: No module named 'django'

Setting $PYTHONPATH explicitly to the parent directory helps.

Change History (1)

comment:1 by Tim Graham, 7 years ago

Component: Testing frameworkDocumentation
Resolution: invalid
Status: newclosed
Summary: Contributing > Writing Code > Unit tests > Quick startErrror in "Contributing > Writing Code > Unit tests > Quick start"

pip install -e .. installs Django in the virtual environment.

Note: See TracTickets for help on using tickets.
Back to Top