alfredodeza / konira

beautiful (readable) testing in Python
60 stars 9 forks source link

User-configurable test sources #11

Closed rudylattae closed 13 years ago

rudylattae commented 13 years ago

Currently konira is hard-wired to look for "case_*.py" files only. Re: https://github.com/alfredodeza/konira/blob/master/konira/collector.py#L13

For someone like me who when using BDD to craft a project, creates technical and feature specs, this is a minor distraction and somewhat limiting. I usually place my specs in "spec(s).py" or "feature(s).py" files.

Kindly consider giving konira users the ability to customize pattern used in the selection of test/case/spec/whatever files to be run as part of the suite.

I'm not sure how something like this would be implemented without being too cumbersome. As an example, Nose can be called with multiple -i params, each of which can specify a regex for selecting test files. It also looks for additional config options in any of the files setup.cfg, .noserc or nose.cfg. For starters, just a commandline param to supply a case insensitive pattern would suffice, e.g.:

$ konira -i "(spec[s]?|example[s]?|feature[s]?)(.py)?"

Or something like that.

alfredodeza commented 13 years ago

This is another, rather easy, fix.

I will add this to the next minor Konira release including your other 2 issues. Thanks for taking the time to report them!

rudylattae commented 13 years ago

Wow, you are on fire! Thanks for taking such speedy action to work on making up poor Winblows saps feel a little less dejected. I'll take a look at your answers to the other issues I raised and provide feedback.

alfredodeza commented 13 years ago

This has been implemented (and tested) in the latest push to ms-support with --collect-match and --collect-ic flags. See the help menu on how to make them work and please let me know how it works for you.

rudylattae commented 13 years ago

Tested and works as expected. I was able to use the command:

$ konira --collect-match ".*spec[s]?|.*feature[s]?\.py$" --collect-ci

to run the specs in:

BouncySpec.py
features.py
long_name_specs.py
major_feature.py
other_spec.py
spec_foo.py
starter_specs.py

:thumbsup: