#23289: Make mock library available for testing in Django
---------------------------------------------+------------------------
               Reporter:  claudep            |          Owner:  nobody
                   Type:  New feature        |         Status:  new
              Component:  Testing framework  |        Version:  master
               Severity:  Normal             |       Keywords:
           Triage Stage:  Unreviewed         |      Has patch:  0
    Needs documentation:  0                  |    Needs tests:  0
Patch needs improvement:  0                  |  Easy pickings:  0
                  UI/UX:  0                  |
---------------------------------------------+------------------------
 This question was raised while working on #21523.
 `unittest.mock` is available in Python 3.3+. Backports for previous Python
 versions are available from https://pypi.python.org/pypi/mock.

 Basically the main options are:

 1. Vendor the mock library backport in Django and conditionally import
 that backport (we used to have that for unittest2).

 2. Use a strategy similar to the `selenium` dependency, that is having a
 test class or a mixin class explicitly used when we are using `mock`
 functionality in a test, and that class would skip the test when `mock` is
 not available.

 3. Have the `mock` library as a hard dependency for our test suite,
 checking its availability in `runtests.py` for Python < 3.3 with an
 appropriate message.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23289>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.ab8f848e8370af178b8c35f04633f000%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to