alfredodeza / pytest.vim

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

Configurable project test directory #74

Closed vecin2 closed 1 year ago

vecin2 commented 4 years ago

Great plugin, simple and work OTB prefect! I just had to tweak slightly to make it work for my requirements: I am working within a project which has multiple 'tests' directories, so I needed to customize the directory used to project tests. I was able to after adding a line to my .vimrc: let g:pytest_test_dir='/my/python/project/root'

And then adding an additional if to your script so that var didn't get overridden:

if !exists("g:pytest_test_dir")
    let g:pytest_test_dir          = 'tests'
endif

I could submit a pull request, but I am sure you could implement this requirement in a much nicer way :)

alfredodeza commented 4 years ago

That is a good catch. I still struggle with the feature of being able to run all the tests in a project (I don't think it is a good idea to run them all inside Vim), but I agree that this variable shouldn't get overridden.

Thank you for the code suggestion, and after reviewing the plugin, I think that would be fine as a PR (to give you credit). If you prefer for me to make the changes, I'm happy to do that as well. Let me know!

vecin2 commented 4 years ago

Then I'll submit a pull request hopefully this weekend.

One more thing, could you elaborate more on why is a bad idea to run all project tests within vim?

Thanks David

On Fri, May 15, 2020, 9:28 AM Alfredo Deza notifications@github.com wrote:

That is a good catch. I still struggle with the feature of being able to run all the tests in a project (I don't think it is a good idea to run them all inside Vim), but I agree that this variable shouldn't get overridden.

Thank you for the code suggestion, and after reviewing the plugin, I think that would be fine as a PR (to give you credit). If you prefer for me to make the changes, I'm happy to do that as well. Let me know!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alfredodeza/pytest.vim/issues/74#issuecomment-629235865, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIMRBACDQED3IRT5KRW3WDRRU7PTANCNFSM4NAGJYNQ .

alfredodeza commented 4 years ago

Here are a few reasons that are concerning to me:

The project testing was a contribution, which I hesitated a lot to get in. But I'm happy that users like you find it great - I just never use it.

alfredodeza commented 1 year ago

Fixed with https://github.com/alfredodeza/pytest.vim/pull/75