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

Sometimes unit tests are dicovered sometimes no #469

Closed
Kurara opened this issue Dec 21, 2017 · 5 comments
Closed

Sometimes unit tests are dicovered sometimes no #469

Kurara opened this issue Dec 21, 2017 · 5 comments
Labels
area-testing feature-request Request for new features or functionality

Comments

@Kurara
Copy link

Kurara commented Dec 21, 2017

Environment data

VS Code version: 1.19.0
Python Extension version: Version 0.9.1
Python Version: 3.5
OS and version: 4.10.0-42-generic 6~16.04.1-Ubuntu SMP

Actual behavior

Sometimes tests are dicovered and some no. With the same code

Steps to reproduce:

  • Click in "Discover unit test"
  • Apears mesagge: "No tests discovered, please check the configuration settings for the tests."

Configurations:

{
"python.pythonPath": "${workspaceFolder}/venv/bin/python",
// tests options
"python.unitTest.pyTestEnabled": false,
"python.unitTest.unittestEnabled": true,
"python.unitTest.nosetestsEnabled": false
}
Folders:
rootprogram
-- djangoapp
---- tests
------ test.py

Where the file with tests is test.py

I know it's a django test. But if I change class for unittest.TestCase it doesn't discover the test either. Yesterday, it found them. Today when I opened the editor (before doing any change), not.

@Kurara Kurara changed the title Sometimes unit tests are dicovered other no Sometimes unit tests are dicovered sometimes no Dec 21, 2017
@DonJayamanne
Copy link

Please could you provide (upload or provide a link to the repo) a sample project that we could use to replicate this issue.
Is the test.py in the test directory?. Looks like your settings.json isn't configured correctly.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster area-testing bug Issue identified by VS Code Team member as probable bug labels Dec 21, 2017
@Kurara
Copy link
Author

Kurara commented Dec 21, 2017

Well, I made a project with just the structure (at least the one for tests) of mine. If you need me to upload more code I can see what can I do. I can't public all the code.

https://github.com/Kurara/unittest_errors

@DonJayamanne
Copy link

How do you run these tests from the terminal? What's the command line?

@Kurara
Copy link
Author

Kurara commented Dec 21, 2017

python manage.py test --settings=settings.unittest
I didnt't add file manage.py to my project. I add it now. It should give you an error about DATABASE because I didn't configure it, but tests can be launch even if they have erros.

But I can launch them too with:
python -m unittest
if I configure first enviroment variable DJANGO_SETTINGS_MODULE (if not it gaves an error but execute the same)

Yesterday I could launch tests with your plugin, today not.

I would like to help you making a djangotest module for your visual code testing. I clone your(Microsoft) repository and I want to try. I even wrote you an email :P

But menawhile I would like to try with unittest

@DonJayamanne
Copy link

Closing in favor of #73

@DonJayamanne DonJayamanne added awaiting 1-decision feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster bug Issue identified by VS Code Team member as probable bug labels Dec 21, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants