#27214: The skipIfDBFeature decorators and its variants should respect their
defined wrapped order and test case inheritance.
-------------------------------------+-------------------------------------
               Reporter:  charettes  |          Owner:  charettes
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:  Testing    |        Version:  master
  framework                          |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 The database features test skipping decorators do not respect the order in
 which they are wrapped or inherited and end up masking the original reason
 that resulted in skipping the test.

 For example given the following test case classes:

 {{{#!python
 @skipIfDbFeature('available')
 @skipUnlessDbFeature('missing')
 class Foo(TestCase):
    def test_foo(self):
         pass

 @skipUnlessDbFeature('also-missing')
 class Bar(Foo):
     def test_bar(self):
         pass
 }}}

 The `Foo.test_foo` method would be skipped with the following reason:
 `'Database has feature(s) available'` and the `Bar.test_bar` method would
 be skipped with `'Database doesn't support feature(s): also-missing'` when
 both should be skipped with `'Database doesn't support feature(s):
 missing'`.

 This is an issue I discovered while working on
 32c0d823e5316aa7d616a69996919b62748368cc where I noticed JSONB tests were
 skipped with the `'Database doesn't support feature(s):
 has_jsonb_datatype'` instead of the expected `'PostgreSQL specific tests'`
 when running tests using the SQLite backend.

--
Ticket URL: <https://code.djangoproject.com/ticket/27214>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.086828a3182c3be402da2ec1eeef052b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to