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

Do not compare types #2034

Merged
merged 2 commits into from
Dec 14, 2023
Merged

Conversation

ni-jfitzger
Copy link
Collaborator

@ni-jfitzger ni-jfitzger commented Dec 9, 2023

  • This contribution adheres to CONTRIBUTING.md.
  • [ ] I've updated CHANGELOG.md if applicable.
  • [ ] I've added tests applicable for this pull request

What does this Pull Request accomplish?

build_test and flake8 started failing with the latest dependencies.

Example:

build/unit_tests/test_metadata_add_all.py:18:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
    assert type(actual) == type(expected), 'Type mismatch, {0} != {1}'.format(type(actual), type(expected))
           ^
build/unit_tests/test_metadata_add_all.py:25:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
    assert type(actual) == type(expected), 'Type mismatch, {0} != {1}'.format(type(actual), type(expected))

This change fixes those flake8 failures, by using isinstance().
For consistency, It also changes some type comparisons in test_grpc.py, where we were ignoring the flake8 error.

List issues fixed by this Pull Request below, if any.

None

What testing has been done?

PR Checks

@ni-jfitzger ni-jfitzger mentioned this pull request Dec 9, 2023
2 tasks
@marcoskirsch marcoskirsch merged commit 4aefebe into ni:master Dec 14, 2023
26 checks passed
@ni-jfitzger ni-jfitzger deleted the fix-build_test-failures branch December 14, 2023 18:54
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.

2 participants