Skip to content

Commit

Permalink
added pspec cli, class doc string support
Browse files Browse the repository at this point in the history
version upgrade
  • Loading branch information
gwthm-in committed Jan 22, 2018
1 parent f3d4cf7 commit 103f878
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions bin/pspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
pytest --pspec $@
7 changes: 5 additions & 2 deletions pytest_pspec/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ def pytest_configure(config):
def pytest_collection_modifyitems(config, items):
for item in items:
node = item.obj
parent = item.parent.obj
nodeid_parts = item.nodeid.split('::')
suf = node.__doc__.strip() if node.__doc__ else node.__name__
nodeid_parts[-1] = suf or nodeid_parts[-1]
if node.__doc__:
nodeid_parts[-1] = node.__doc__.strip()
if parent.__doc__:
nodeid_parts[-2] = parent.__doc__.strip()
item._nodeid = '::'.join(nodeid_parts)


Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def read(fname):

setup(
name='pytest-pspec',
version='0.0.1',
version='0.0.2',
description='A rspec format reporter for Python ptest',
long_description=read('README.rst'),
author='Gowtham Sai',
Expand All @@ -24,6 +24,7 @@ def read(fname):
'pytest>=3.0.0',
'six>=1.11.0',
],
scripts=['bin/pspec'],
packages=['pytest_pspec'],
classifiers=[
'Development Status :: 4 - Beta',
Expand Down

0 comments on commit 103f878

Please sign in to comment.