Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Not a test file" error when running any of the ':Test...' commands #674

Open
JustAChucklin opened this issue Aug 2, 2022 · 5 comments
Open

Comments

@JustAChucklin
Copy link

JustAChucklin commented Aug 2, 2022

I am receiving a Not a test file error when I am running the vim-test plugin. This is a fresh install. I am at the early stages of being an intermediate user of NeoVim. The details of the type of tests that I am trying to run are below:

  1. Currently trying to run any test_runner for python and I am getting the error mentioned above.
    1.1 Have tried the basic, nose, and nose2
  2. Have looked through my init.vim, and it seems right. I am wondering if there is an issue with my python config or something on that side of the fence and not so much to do with my neovim

If there is anything that I can provide to help in resolving this please let me know, I would like to make this as easy as possible for you all :).

Thanks!

@rafpaf
Copy link

rafpaf commented Dec 28, 2022

I looked through the vim-test code and noticed that, for javascript at least, the plugin assumes that package.json is in the current working directory, and if it's not there, the plug just says "Not a test file". I'm guessing it's the same for python. I wonder if your problem is along those lines.

@mihaigalos
Copy link
Contributor

Reproducible with unittest.

@codeinabox
Copy link
Collaborator

I looked through the vim-test code and noticed that, for javascript at least, the plugin assumes that package.json is in the current working directory, and if it's not there, the plug just says "Not a test file". I'm guessing it's the same for python. I wonder if your problem is along those lines.

It is correct that vim-test does not currently support mono-repos and you need to set the working directory.

@JustAChucklin @mihaigalos are you running these tests within a mono-repo or a standard single project?

@mihaigalos
Copy link
Contributor

A single folder containing 1 source py file with the logic aand another with the test.

@mihaigalos
Copy link
Contributor

Seems I was missing let test#python#runner = 'pyunit' in my .vimrc and vim-test was using pytest by default, not pyunit.

Also, by default python is called. Some platforms, such as MacOS only have python3. Since python2 is deprecated, would it not make more sense to fix this in this repo? I can contribute a PR if so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants