wiremock / python-wiremock

A Python library for API mocking and testing with Testcontainers module and WireMock

Home Page:https://wiremock.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax warning due to comparison of literals using is in Python 3.8

tirkarthi opened this issue · comments

find . -iname '*.py' | grep -v example | xargs -P4 -I{} python3.8 -Wall -m py_compile {}
./wiremock/base/base_resource.py:150: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif sc is 401:  # pragma: no cover
./wiremock/base/base_resource.py:152: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif sc is 403:  # pragma: no cover
./wiremock/base/base_resource.py:154: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif sc is 404:  # pragma: no cover
./wiremock/base/base_resource.py:156: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif sc is 422:  # pragma: no cover
./wiremock/base/base_resource.py:160: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  elif 400 <= sc < 500 and sc is not 404:  # pragma: no cover