forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Milestone
Description
Refs: #21149
Author: @eleanorjboyd
Prerequisites:
Use the following repo of tests or use your own repo of unittest https://github.com/eleanorjboyd/inc_dec_example_repo
Background Information:
This rewrite is for the underlying infrastructure of how python handles testing therefore all behavior visible to the user should be pretty much the same (minus maybe some error logs going in a better place or test names shortened). Therefore throughout this testing, you can reference the current testing in Python to compare if you think something doesn't look right (or you can always post here too!).
Steps:
Part 0: Setup
- make sure you have the setting
"python.experiments.optInto": ["All"] - Open the inc_dec_example_repo/inc_dec_example_test_suite testing repo folder in vscode
- Use the create environment command from the command palette, select venv and whatever python version you want >=3.7
- In the terminal run
python -m pip install pytest - From the command palette run
python: configure testsselectunittestand"."(root directory) andtest_*.py
Part 1: UI Nesting & Run
- Go to the testing explorer, and confirm all the tests are discovered
Part 2: Debugging
- add some break points to the unittest tests and check to make sure these break points are hit
- make sure you can do other normal debugging actions (stop, restart, step over, etc)
Part 3: Large Files
- change for
i in range(0, 100):intest_subtest.pyto be much larger likei in range(0, 10000):and make sure it both works for discovery and run tests (tests should be displayed on the test explorer after discovery and run)
Part 4: Seeing Dynamic Run
- Expand the testing explorer UI to see all the nodes (especially
test_two_classes.pywhich has a wait inside one of its tests) - Click run all and make sure that you are seeing the nodes on the test UI finish at different times (ie they don't all resolve together, like some are still spinning while others are complete with a check or an x)