pchomik / pytest-spec

Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION.
GNU General Public License v2.0
100 stars 19 forks source link

Display only class name instead of `path::class name`? #10

Closed ckcollab closed 7 years ago

ckcollab commented 8 years ago

Heyo, thanks so much for putting this together! Works perfectly, but I was wondering if it was possible to turn this:

src/apps/businesses/tests/office_mgmt.py::OfficeManagementTests
    [PASS]  Can only add office to company you belong to

Into this

OfficeManagementTests
    [PASS]  Can only add office to company you belong to

Changing some/path::ClassName into ClassName?

Not sure the best way to go about it, py.test --spec --spec-hide-paths seems weird.

pchomik commented 8 years ago

Hello,

Let's add some new parameter. I have to think about proper name.

ckcollab commented 8 years ago

Yeah I can't think of a good name either... could also have special formatting from pytest.ini? Like

[pytest]
spec_hide_paths=True
# or
spec_path="{ path }::{ class_name }"
# And for my purposes I'd do
spec_path="{ class_name }"

But, that may be overkill, unless some other functionality could benefit from such a setup?

Thanks again 💃

pchomik commented 8 years ago

I like spec_hide_paths. IMO we should provide pytest.ini and command line option for that.

0x64746b commented 8 years ago

I'd actually like to go one step further and also split the class name at uppercase letters and drop the Test prefix, to get something that behaves like the pinocchio spec plugin/testdox:

Office Management
    [PASS]  Can only add office to company you belong to

How do you feel about this?

Thx dtk