allure-framework / allure-python

Allure integrations for Python test frameworks
https://allurereport.org/
Apache License 2.0
719 stars 235 forks source link

Replace direct type comparisons with isinstance #760

Closed delatrie closed 1 year ago

delatrie commented 1 year ago

Context

The linting rule E721 was changed in pycodestyle v2.11 referred by flake8 v6.1.0. See more details here and here.

Now these two forms are acceptable:

isinstance(obj, obj_type)
type(obj) is obj_type

While this one is not:

type(obj) == obj_type

This PR fixes all occurrences of the unacceptable form in the codebase.