create a faust.App instance during testing
for the example, there are only 2 files app.py files with a single topic and an event handler
and a test.py file that calls this handler
I want to test event handlers from kafka by calling them directly with a prepared dataset while working directly with faust.Record.
and I want to use the test log in the Pipeline.
Actual behavior
Testing works, but I'm getting side effects DeprecationWarning: pkg_resources is deprecated as an API
Full traceback
$ python -Werror -m pytest
================================================================================ test session starts =================================================================================
platform linux -- Python 3.11.10, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/dmitry/
configfile: pytest.ini
plugins: metadata-3.1.1, cov-5.0.0, Faker-25.9.2, anyio-4.4.0, html-4.1.1
collected 44 items / 1 error
======================================================================================= ERRORS =======================================================================================
from src.kafka.app import app
src/kafka/app.py:11: in <module>
app = faust.App(
.venv/lib/python3.11/site-packages/faust/app/base.py:498: in __init__
self.fixups = self._init_fixups()
.venv/lib/python3.11/site-packages/faust/app/base.py:550: in _init_fixups
return list(fixups(self))
.venv/lib/python3.11/site-packages/faust/fixups/__init__.py:28: in fixups
for Fixup in FIXUPS.iterate():
.venv/lib/python3.11/site-packages/mode/utils/imports.py:96: in iterate
self._maybe_finalize()
.venv/lib/python3.11/site-packages/mode/utils/imports.py:132: in _maybe_finalize
self._finalize()
.venv/lib/python3.11/site-packages/mode/utils/imports.py:136: in _finalize
self.aliases.update(dict(load_extension_class_names(namespace)))
.venv/lib/python3.11/site-packages/mode/utils/imports.py:371: in load_extension_class_names
from pkg_resources import iter_entry_points
.venv/lib/python3.11/site-packages/pkg_resources/__init__.py:111: in <module>
warnings.warn(
E DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
============================================================================== short test summary info ===============================================================================
ERROR tests/test.py - DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================== 1 error in 0.66s ==================================================================================
Hi, this is a known issue in https://github.com/faust-streaming/mode/issues/60 I've been trying to tackle. I've also been taking a break from open-source development, so I'll hopefully get back to this soon.
Steps to reproduce
create a faust.App instance during testing for the example, there are only 2 files app.py files with a single topic and an event handler and a test.py file that calls this handler
Expected behavior
I want to test event handlers from kafka by calling them directly with a prepared dataset while working directly with faust.Record. and I want to use the test log in the Pipeline.
Actual behavior
Testing works, but I'm getting side effects
DeprecationWarning: pkg_resources is deprecated as an API
Full traceback
Versions