alfredodeza / pytest.vim

Runs your UnitTests with py.test displaying red/green bars and errors
274 stars 39 forks source link

Allow to "just" run py.test in the current working directory #16

Closed blueyed closed 10 years ago

blueyed commented 10 years ago

I would like to invoke the plugin without any file/dir arguments: the tests to be run should get discovered/collected automatically (depending on the config file).

This does not appear to be supported, is it?

While at it, something like "Pytest repo" might be useful, where py.test gets run in the current repository root (this could use/depend on the following plugin: https://github.com/jmcantrell/vim-reporoot).

For now, however, running it from the current working directory would be useful enough. Maybe just use this as the default action?

alfredodeza commented 10 years ago

Funny you ask, this was added a week ago!

Can you confirm that the new object for the plugin, called project works for you?

:Pytest project

This is also documented here: https://github.com/alfredodeza/pytest.vim#python-objects

blueyed commented 10 years ago

I have seen that there is the "project" object - but it is restricted by a given folder/file in the project.

This is different from running py.test in the current working directory / root.

I think it would be useful to have an option to run it in the current dir, or pass an dir optionally (e.g. for a custom mapping, where you want to run it in the dir where pytest.ini is located).

alfredodeza commented 10 years ago

The purpose of the plugin was always to be able to concentrate on the file you are working on. It seems to me that allowing to point to directories defeats that. Even the project seemed overkill at some point.

This would be the same reason why extra flags (or custom ones) are not supported, they bring complexity and will end up breaking the plugin.

alfredodeza commented 10 years ago

This is probably not a good use case for the plugin, given that Vim is single threaded and blocks when we call py.test, potentially blocking the editor for a long time if tests are triggered for a whole project.

If you think a different approach might be reasonable here, feel free to re-open this issue.