Skip to content

Print module docstrings in spec output #28

Description

@codeinthehole

I would find it useful if the spec output included the module docstring as well. This would let me set some context for the following TestCases.

Example

For example, for functional tests I end up naming my TestCases things like:

class TestAnAdmin(WebTest):
    def test_can_create_a_new_product(self):
        ...

which outputs as:

An admin
- can create a new product

But the trouble is I end up with lots of TestCases with the same name and the spec output is a little confusing.

Proposal

It would be good if I could use a module docstring to distinguish between test modules. Eg:

"""
Product dashboard
"""

class TestAnAdmin(WebTest):
    def test_can_create_a_new_product(self):
        ...

would lead to something like:

Product dashboard
-----------------
An admin
- can create a new product

Category dashboard
------------------
An admin
- can create a new category

The underlining is optional. It might be better to use a bold font or simply leave it to the docstring to distinguish the module docstrings.

Sensible?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions