File: faq.rst

package info (click to toggle)
python-ddt 1.7.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 256 kB
  • sloc: python: 785; makefile: 147; sh: 11
file content (23 lines) | stat: -rw-r--r-- 571 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Known Issues and FAQ
====================

Docstring Handling
------------------

If one of the passed data objects has a docstring, the resulting testcase borrows it.

.. code-block:: python

    d1 = Dataobj()
    d1.__doc__ = """This is a new docstring"""

    d2 = Dataobj()

    @data(d1, d2)
    def test_something(self, value):
        """This is an old docstring"""
        return value


The first of the resulting test cases will have ``"""This is a new docstring"""`` as its docstring and the second will
keep its old one (``"""This is an old docstring"""``).