Add async support to TrackQuery decorator#37
Conversation
|
Hi @yog-32, Can you fix your PR? None of the tests are passing. Also add a few examples for the functionality you are adding. |
|
I have done necessary changes. Looking forward to your feedback! 😊 |
MuddyHope
left a comment
There was a problem hiding this comment.
I'll test it once you have taken care of these changes.
| record = caplog.records[0] | ||
| assert record.levelname == "ERROR" | ||
| assert "MyClass" in record.message | ||
| assert "do_slow_work" in record.message |
|
|
||
| # Set up logger | ||
| logger = logging.getLogger("pyquerytracker") | ||
| logger.setLevel(logging.DEBUG) |
|
|
||
| MyClass().do_work(2, 3) | ||
| assert len(caplog.records) == 1 | ||
| record = caplog.records[0] |
There was a problem hiding this comment.
Don't modify the pre-existing test cases for them to pass.
|
Hello, I think the CI build is currently failing on the new async tests. This appears to be due to the "pytest-asyncio" dependency not being installed in the CI environment. The tests are running fine on my local machine, so the failures likely stem from missing dependencies during CI runs. To resolve this, I’ve updated pyproject.toml to include all development dependencies under an optional [test] extras group, following modern Python packaging standards. To install the necessary test dependencies, please run: python -m pip install ".[test]" Let me know if the tests still fail after installing the extras—I’ll be happy to investigate further if needed. |
|
Hey @MuddyHope!, have you tried installing pytest-asyncio? The tests need it, and my code’s good to go once that’s in place! |
|
Can you resolve these conflicts, @yog-32. I'll test out these before merging. |
|
Can you pull latest main @yog-32, and resolve the conflicts? |
|
Thanks @yog-32, it's merged. |

What does this PR do?
Adds support for tracking async functions using the TrackQuery decorator.
Why is this needed?
Many modern frameworks (FastAPI, asyncpg, etc.) use async DB operations.
What was changed?
Related Issue:
Fixes #31