Opened 10 years ago

Closed 10 years ago

#23666 closed Cleanup/optimization (fixed)

The command to run the unit tests doesn't work on windows

Reported by: Baptiste Mispelon Owned by: Andreas Savvides
Component: Documentation Version: 1.7
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the contributing guide [1], the command given to run the test suite is the following:

$ git clone https://github.com/django/django.git django-repo
$ cd django-repo/tests
$ PYTHONPATH=..:$PYTHONPATH ./runtests.py

The first two instructions work fine on windows as far as I know but the first one won't because windows doesn't support setting environment variables this way.

[1] https://docs.djangoproject.com/en/1.7/internals/contributing/writing-code/unit-tests/#quickstart

Change History (7)

comment:1 by Tim Graham, 10 years ago

Easy pickings: unset
Triage Stage: UnreviewedAccepted

I use "Git Bash" on Windows instead of tcmd.exe and the command above works fine. Maybe we should recommend something like that?

comment:2 by Aymeric Augustin, 10 years ago

Yes, in my experience Git Bash is the least unusable option on Windows.

comment:3 by Joeri Bekker, 10 years ago

The Windows (near) equivalent is to use with cmd.exe:

$ git clone https://github.com/django/django.git django-repo
$ cd django-repo\tests
$ set PYTHONPATH=..;%PYTHONPATH%
$ python runtests.py

The third line extends your PYTHONPATH with the parent directory for the duration of the terminal session.
I added the python command in line 4, to use the one that is set in the PATH rather than the one registered with Windows.

In my opinion the documentation doesn't need to have a Windows equivalent of common bash commands.

comment:4 by Andreas Savvides, 10 years ago

Owner: changed from nobody to Andreas Savvides
Status: newassigned

comment:5 by Andreas Savvides, 10 years ago

Has patch: set

comment:6 by Andreas Savvides, 10 years ago

Here is a link to my patch: https://github.com/django/django/pull/4371

comment:7 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 118cae2:

Fixed #23666 -- Recommended Git Bash for running unit tests on Windows.

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