Skip to content

Updated _find_left_bracket function used in pytest discovery to fix bug#17955

Closed
scwilbanks wants to merge 3 commits into
microsoft:mainfrom
scwilbanks:find_left_bracket_bug_fix
Closed

Updated _find_left_bracket function used in pytest discovery to fix bug#17955
scwilbanks wants to merge 3 commits into
microsoft:mainfrom
scwilbanks:find_left_bracket_bug_fix

Conversation

@scwilbanks
Copy link
Copy Markdown

@scwilbanks scwilbanks commented Nov 7, 2021

Fix for #17954, #17951.

Instead of assuming an equal number of open and closed brackets as the current function does, this change assumes that the first open bracket of the last double colon "::" will be the bracket it is looking for. Since the testname will correspond to a python function, which cannot contain open brackets, the first open bracket must be it.

@ghost
Copy link
Copy Markdown

ghost commented Nov 7, 2021

CLA assistant check
All CLA requirements met.

@scwilbanks
Copy link
Copy Markdown
Author

I ran black to fix the linting error, but I don't know why the venv check failed.

I also see a previously approved pull request (#17881) that already solved the problem in a different and probably better way.

@karthiknadig
Copy link
Copy Markdown
Member

@scwilbanks Thanks for the PR. I think we want to go with the fix here #17881. The venv test failed due to pipenv end of 2.7 support. Not related to this change.

Can you test with the build from the PR #17881 and confirm that it works?
This is the build from that PR https://github.com/microsoft/vscode-python/suites/4250577747/artifacts/110667889

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants