You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Clone the test repo from [[here](https://github.com/eleanorjboyd/inc_dec_example_repo)](https://github.com/eleanorjboyd/inc_dec_example_repo) or use your own repo of pytests.
2. Launch VSCode and open the `inc_dec_example_repo/inc_dec_example_test_suite` testing repo folder.
3. Add the following to your settings in VSCode: `"python.experiments.optInto": ["pythonTestAdapter"],`
4. Use the "create environment" command from the command palette, select `venv` and a Python version >=3.7.
5. (for pytest)
1. In the terminal, run `python -m pip install pytest`.
2. From the command palette, run "python: configure tests", select `pytest` and then "." (root directory)
6. click the test explorer icon (beaker)
7. configure tests
1. pytest: pytest → root
Testing:
in your settings.json you should see a "python.testing.pytestArgs": [] make the following changes and see the desired output. Output will be in the Test Results panel unless stated otherwise
Testing Output TPI specifics
Add --color=yes
check to see if the results are in color
switch to using log level error
check to see that only error and critical logs show up (change back after)
in the test result panel click on a failed test item
check that you can see a stack trace of sorts about the failed test
change test assert to assert True
check that printing and logging does not appear
Add ["-o", "log_cli=true"], and keep assert True
check that logging now occurs
From the terminal run python -m pytest test_logging.py and make sure it looks the same as it looks when you run just test_logging.py from the test explorer
Non execution related tests
Add -v to the args, set vscode log level to trace , then check in the “python” logs that you can see the list of tests discovered
Is this just the python logging level in settings or is there a pytest argument to do this? I don't see any difference when using the python log level setting
Refs: 21861
Complexity: 4
Author: @eleanorjboyd
Create Issue
Create Issue
Thank you for doing this testing!
Setup
settings.json
you should see a"python.testing.pytestArgs": []
make the following changes and see the desired output. Output will be in theTest Results
panel unless stated otherwiseTesting Output TPI specifics
--color=yes
error
andcritical
logs show up (change back after)assert True
["-o", "log_cli=true"]
, and keepassert True
python -m pytest test_logging.py
and make sure it looks the same as it looks when you run justtest_logging.py
from the test explorerNon execution related tests
-v
to the args, set vscode log level totrace
, then check in the “python” logs that you can see the list of tests discoveredsomething like the following:
The text was updated successfully, but these errors were encountered: