简体   繁体   中英

Running Django tests in Docker Windows

I am trying to run the tests of a Django project inside a container which is running on a Windows host. The problem is that when I run the command: python manage.py test I get the following erros for all my files:

myproj/tests/tests_forms/test_product_form.py is executable; skipped

I've checked the file permissions and all of them have execute permissions: -rwxr-xr-x . I've tried to change this using chmod , but it doesn't work probably because I am running docker on Windows.

Is there a way around this? Maybe some way to force Django to run the tests regardless of the file permissions?

If you're using nose (or django-nose), executable python scripts are skipped by default. According to the docs , it's because "they may not be import-safe".

If you run nosetests directly, you can use the --exe argument to include executable files: nosetests --exe .

If you're using the django-nose package, you can use the NOSE_INCLUDE_EXE environment variable to accomplish the same thing: NOSE_INCLUDE_EXE=1 python manage.py test

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM