-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Nose Tests discovery fails when tests are split by folders and imported to __init__.py (wantModule and wantDirectory are not parsed) #7124
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
Comments
Thanks for letting us know about this, @IBestuzhev. This sounds similar to a problem with the latest version of pytest (#6990), where the XML output changed. We use JUnit XML files to get the output from nose. Was this working on an earlier version of nose? If so then we can look into that further. Just in case that isn't the problem, I have some questions that may help us figure out what is going on:
Also note that our support for nose is fairly low, due to lack of demand. However, that doesn't mean we won't try to help you resolve this issue. :) |
Thanks @ericsnowcurrently Yes, I understand it's quite rare issue, the project is legacy and so it uses not recent versions.
Never checked before.
nose==1.3.7
That is Django project, so I can't run The error is But I can run So for test discovery I run
It translates
|
@IBestuzhev, we've added a fix for our JUnit XML parsing. Please see if that fixes the problem. It is available through the "insiders" build of the extension (set the |
Hi @ericsnowcurrently Nothing changed. Also, my initial problem was with parsing of Nose output, not JUnit output. |
@IBestuzhev, sorry for the confusion. I was able to reproduce the problem using the steps you originally provided. It looks like we expect a file to be picked if a class is picked, but that isn't the case here. In my nose output I see the following:
We'll investigate further. |
My full nose output:
|
I'm experiencing a similar (or same) issue. Also using nose 1.3.7, but on Python 3.7, macOS 10.15, and VSCode 1.45.0. @IBestuzhev your shell script idea worked for me, although I modified it to work on macOS. Thanks! |
Closing via #16371 |
Environment data
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version #3977): jediExpected behaviour
Test discovery for nose should scan for both
wantFile
andwantModule
and/orwantDirectory
log outputsActual behaviour
We have a
django
project withdjango-nose
test runner. Tests are split into modules, and all tests are imported to__init__.py
. I think these are some obsolete tests, from default django test runner. But nose runs them perfectly.I create a simple script, that translates the
nosetests
call to./manage.py test
call.Basically it just strips
-vvv
and replaces it with--verbosity
The structure of tests is (stripped)
File
backend/apps/tests/__init__.py
File
backend/apps/tests/action.py
The output of
--collect-only
command is different to whatvscode-python
expects.Relevant output to tests above is:
parserService
here scans only forwantFile
output.In case above it founds
wantClass
above anywantFile ... py? True
line. That causestestFile.suites.push(testSuite);
to failSteps to reproduce:
tests
action.py
to package with some real test caseaction
insidetests/__init__.py
Python: Discover Tests
commandLogs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)The text was updated successfully, but these errors were encountered: