Skip to content

Unittest top-level-directory option - #19398

Merged
Karthik Nadig (karthiknadig) merged 4 commits into
microsoft:mainfrom
dazfuller:dazfuller/unittest-topleveldir
Jul 14, 2022
Merged

Unittest top-level-directory option#19398
Karthik Nadig (karthiknadig) merged 4 commits into
microsoft:mainfrom
dazfuller:dazfuller/unittest-topleveldir

Conversation

@dazfuller

@dazfuller Darren Fuller (dazfuller) commented Jul 2, 2022

Copy link
Copy Markdown

This is related to issues #5721 and #6881 and adds support for the -t/--top-level-directory argument for test discovery when using unittest.

The following changes have been made.

  • add new function unittestGetTopLevelDirectory to get top level directory value from options
  • If provided then pass this value to the test discovery and test runner processes
    • If not provided then it is omitted so that tests continue to run as they do currently
  • Uses the --ut option already available in the visualstudio_py_testlauncher.py script

The import cleanup in the python files was done automatically by pylance.

@ghost

Deleted user (ghost) commented Jul 2, 2022

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@karthiknadig Karthik Nadig (karthiknadig) added the bug Issue identified by VS Code Team member as probable bug label Jul 7, 2022
@dazfuller

Copy link
Copy Markdown
Author

Reviewed the testing page on the wiki, the edited TS files are not currently part of any test suite. Please advise

@karthiknadig Karthik Nadig (karthiknadig) added the skip tests Updates to tests unnecessary label Jul 7, 2022
@karthiknadig

Copy link
Copy Markdown
Member

Darren Fuller (@dazfuller) I have cleared the check for you. No worries.

@karthiknadig
Karthik Nadig (karthiknadig) merged commit 4ecf02b into microsoft:main Jul 14, 2022
@dazfuller
Darren Fuller (dazfuller) deleted the dazfuller/unittest-topleveldir branch July 18, 2022 13:42
Wes McKinney (wesm) pushed a commit to posit-dev/positron that referenced this pull request Mar 28, 2024
* update unittest discovery to work with user defined top-level-directory

* change to make top-level-dir optional

* add top-level-dir to unittest run args

* update test discovery to use top-level-directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug skip tests Updates to tests unnecessary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants