ni / nimi-python

Python bindings for NI Modular Instrument drivers.
Other
112 stars 84 forks source link

Do not compare types #2034

Closed ni-jfitzger closed 9 months ago

ni-jfitzger commented 9 months ago

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