0

Having such class marked with pytest.mark.parametrize:

@pytest.mark.parametrize('app_lang', MobileAppLanguageMark.all(), scope='session')
class MobileBaseCase(BaseCase):
    def foo(self, a, b):
        """
        assadasdasda
        """
    return a,b

I'm trying to use sphinx autodoc to generate the docs. This is mobile_base_case.rst file:

MobileBaseCase
=========================

.. autoclass:: plugin.lib.mobile.common.mobile_base_case.MobileBaseCase
   :members:
   :undoc-members:
   :show-inheritance:

The resulting html file after make html has only enter image description here

I've also tried using

.. automethod:: foo(self, a, b)
.. automethod:: plugin.lib.mobile.common.mobile_base_case.MobileBaseCase.foo(self, a, b)

but with no luck.

Is there a way to make autodoc ignore the mark and generate docs for MobileBaseCase class?

mzjn
  • 48,958
  • 13
  • 128
  • 248
Ciszko
  • 175
  • 1
  • 13
  • You can make sphinx unwrap all ``pytest.mark.…`` instances, but the easiest approach would be just not to wrap it in the first place. At least in the example, the parametrization seems out of place. What *do* you document a class that is parametrized for unittesting with incompatible arguments? – MisterMiyagi Sep 08 '21 at 12:07
  • The problem is that it has to be wrapped. In my framework this class has some generic methods for all test cases. Parametrizing is used to define the app language. Making sphinx unwrap it is more suitable solution here – Ciszko Sep 08 '21 at 12:46

0 Answers0