nosecomplete icon indicating copy to clipboard operation
nosecomplete copied to clipboard

ENH: Add support for module-style paths in addition to file-style paths.

Open ssanderson opened this issue 10 years ago • 4 comments

Adds support for autocompleting paths that look like foo.bar:Buzz in addition to foo/bar:Buzz. This makes it easier to re-run tests from a previous run, since nose prints filenames as modules by default.

ssanderson avatar Jun 24 '14 15:06 ssanderson

Thanks for opening the pull request! I want to add this feature but I'm wondering if it's better to import the module if it's a module name (for example: my code is available in PYTHONPATH but not in the project's root directory so I would have to chdir).

alonho avatar Jun 25 '14 12:06 alonho

I'll get back to this in a few days once I return home from a conference. Thanks again.

alonho avatar Jun 25 '14 12:06 alonho

The main concern I'd have about enabling this syntax via importing is that doing so might take a fair amount of time/cause nontrivial side-effects. In particular, I think it's a pretty common idiom to use setUpModule to do things like initialize database connections and populate test data. Maybe this could be made toggle-able in a manner similar to how the test discovery methods are currently managed?

ssanderson avatar Jul 01 '14 07:07 ssanderson

would you mind adding some tests?

alonho avatar Jul 01 '14 13:07 alonho