Python testing do not run tests with decorator @file_data(from ddt import file_data)
See original GitHub issueEnvironment data
- VS Code version: 1.60.1
- Extension version (available under the Extensions sidebar): v2021.9.1230869389
- OS and version: Fedora 33
- Python version (& distribution if applicable, e.g. Anaconda): 3.9.7
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): virtualenv
- Relevant/affected Python packages and their versions: N/A
- Relevant/affected Python-related VS Code extensions and their versions: Pylance v2021.9.1
- Value of the
python.languageServer
setting: Pylance
Expected behaviour
All unittest will be run.
Actual behaviour
Click “run tests” runs all testcases expect testcases with decorator @file_data which is imported from ddt module. I copy the test data out, and set them in decorator @data, tests runs OK.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Example usage — DDT 1.5.0 documentation - Read the Docs
Example usage¶. DDT consists of a class decorator ddt (for your TestCase subclass) and two method decorators (for your tests that want to...
Read more >Multiply your Python Unit Test Cases with DDT
DDT (Data-Driven Tests) is a small python module that allows you to multiply your unit test cases for free. The idea is pretty...
Read more >Python unittest does not run tests - Stack Overflow
I corrected the module import, but the 'run configuration' was still there, causing it to run as a Python script and not as...
Read more >unittest — Unit testing framework — Python 3.11.1 ...
If setUp() succeeded, tearDown() will be run whether the test method succeeded or not. Such a working environment for the testing code is...
Read more >Python unittest tests do not work unless running within a ...
The workaround for the issue is: create a vscode workspace; use 'File->Add folder to workspace' to add the python folder to the workspace;...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @karthiknadig, @wind-chh I have merged the PR with a proposed fix for that (
ddt==1.4.3
). Please see if that fixes your issue.@wswld @karthiknadig Thank you! It works well for me now.