FastAPI-template icon indicating copy to clipboard operation
FastAPI-template copied to clipboard

pytest is not working with kafka

Open ker-zhao opened this issue 2 years ago • 3 comments
trafficstars

The following code is from lib/python3.11/site-packages/kafka/conn.py:79, if I didn't install gssapi it should be catched by ImportError, but if it's run by pytest, then there will be a ImportWarning instead of ImportError, so the following code won't work properly.

try: import gssapi from gssapi.raw.misc import GSSError except ImportError: #no gssapi available, will disable gssapi mechanism gssapi = None GSSError = None

ker-zhao avatar Oct 26 '23 05:10 ker-zhao

Will take a closer look. Thanks for reporting.

s3rius avatar Oct 31 '23 12:10 s3rius

Its due to an out-of-date vendored version of six in python-kafka (dependency of aiokafka). An update was pushed to their master to push their version to 1.16 2 days ago (https://github.com/dpkp/kafka-python/pull/2398), however, python-kafka hasnt had a tagged update in years...

danboyle7 avatar Nov 03 '23 21:11 danboyle7

Well, we can depend on the tag revisions from repo.

s3rius avatar Nov 04 '23 11:11 s3rius