alfredodeza/konira — pull request #23 by superduper (2013-10-09 17:33:07+00:00)
Title: Improve case class filter

There's a problem with case class harvester: https://github.com/alfredodeza/konira/blob/master/konira/runner.py#L234-L236

When you have a global var that has no ``__name__`` attribute in your spec:
```python
from functools import partial
foo = partial(dict, yay=1)

describe "feature":
it "does something cool":
print "yay!"
```

It will choke on bootstrap:

```
$ find . -name "*.pyc" -exec rm -f {} \;
$ konira -x -t -s tests/case_foo.py

Errors:
-------

1 ==> AttributeError: 'functools.partial' object has no attribute '__name__'
File: /Users/dada/.virtualenvs/dada/lib/python2.7/site-packages/konira/runner.py:236:
Traceback (most recent call last):
File "/Users/dada/.virtualenvs/dada/lib/python2.7/site-packages/konira/runner.py", line 236, in _collect_classes
return [i for i in global_modules[0].values() if callable(i) and i.__name__.startswith('Case_')]
AttributeError: 'functools.partial' object has no attribute '__name__'

```

This patch will fix it :)