Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python and Pylint warnings in windows_testing.py #116

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

gilles-peskine-arm
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm commented Jul 20, 2023

Fix a warning that appears whenever running windows_testing.py, including in CI logs:

windows_testing.py:185: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if name is not "Results":

Also fix a few things reported by Pylint. I do not try to be exhaustive there, I just fixed some slightly dodgy code and silenced a few warnings for which I could do so quickly and without risk. Passing pylint is out of scope of this pull request.

CI run:

It worked as intended because the string is a literal and CPython
(which our CI uses) merges string literals at compile time. But it was
fragile with respect to code changes or using another Python
implementation.

This fixes the diagnostic emitted by python when running the script:
```
windows_testing.py:185: SyntaxWarning: "is not" with a literal. Did you mean "!="?
    if name is not "Results":
```

Signed-off-by: Gilles Peskine <[email protected]>
Fix regex strings missing an r prefix, and a docstring containing what
was intended to be a literal backslash.

Signed-off-by: Gilles Peskine <[email protected]>
When re-raising an exception, show the original backtrace,
independently of any logging.

Signed-off-by: Gilles Peskine <[email protected]>
In all of these cases, one test in a series has failed, so we make a
note of the failure and continue.

Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm gilles-peskine-arm added enhancement New feature or request needs: ci priority-medium size-xs Estimated task size: extra small (a few hours at most) needs: review needs: reviewer and removed needs: ci labels Jul 20, 2023
Copy link

@tgonzalezorlandoarm tgonzalezorlandoarm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor comment, LGTM otherwise.

resources/windows/windows_testing.py Outdated Show resolved Hide resolved
Signed-off-by: Gilles Peskine <[email protected]>
Copy link

@tgonzalezorlandoarm tgonzalezorlandoarm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs: review needs: reviewer priority-medium size-xs Estimated task size: extra small (a few hours at most)
Projects
Status: In Development
Development

Successfully merging this pull request may close these issues.

2 participants