chore(pipelines): standardize pytest and testing patterns across Python solution guides - #272
Merged
iht merged 2 commits intoSep 7, 2026
Conversation
…on solution guides - Standardize requirements-dev.txt across all 5 Python pipelines with compatible version ranges (pytest>=9.0,<10.0, pylint>=4.0,<5.0, yapf>=0.43,<1.0, setuptools>=78). - Add baseline unit tests (7 tests) for ml_ai_python covering prompt formatting, output parsing, and pipeline options. - Update CI workflow (pull_request.yml) to execute tests with PYTHONPATH=. pipenv run pytest tests/ -v. - Group Python dev tools (pytest, pylint, yapf) in renovate.json under python-dev-tools. - Align AGENTS.md, dataflow-pipeline-dev skill, and all pipeline READMEs to instruct running tests with pytest tests/ -v.
iht
commented
Sep 7, 2026
| ```bash | ||
| python -m unittest discover -s tests -v | ||
| pytest tests/ -v | ||
| python -m unittest discover -s training/tests -v |
Member
Author
There was a problem hiding this comment.
Should not we use also pyttest for the training tests?
Member
Author
There was a problem hiding this comment.
Yes, absolutely! Updated pipelines/anomaly_detection/README.md and use_cases/Anomaly_Detection.md to pytest training/tests/ -v for full consistency.
| python -m unittest discover -s tests -v | ||
| pytest tests/ -v | ||
| python -m unittest discover -s training/tests -v | ||
| python -m unittest discover -s serving/tests -v |
Member
Author
There was a problem hiding this comment.
Should not we use also pyttest for the serving tests?
Member
Author
There was a problem hiding this comment.
Yes! Added fastapi>=0.115,<1 and httpx>=0.28,<1 to pipelines/anomaly_detection/requirements-dev.txt so pytest serving/tests/ -v can execute locally without requiring the Docker container, and updated pipelines/anomaly_detection/README.md and use_cases/Anomaly_Detection.md to pytest serving/tests/ -v.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Harmonizes the Python testing methodology, developer dependencies, CI test execution, and documentation across all solution guides in the repository.
Key Changes
Requirements Standardization:
requirements-dev.txtacross all 5 Python pipelines using non-breaking version ranges:yapf>=0.43,<1.0pylint>=4.0,<5.0pytest>=9.0,<10.0setuptools>=78pipelines/anomaly_detection,pipelines/iot_analytics, andpipelines/ml_ai_python.requirements-dev.txttopipelines/cdpandpipelines/marketing_intelligence.Baseline Unit Tests for
ml_ai_python:pipelines/ml_ai_python/tests/test_pipeline.pywith 7 unit tests covering turn tag prompt formatting, output parsing (PredictionResult), choices formatting, andMyPipelineOptionsparsing with default model presetgoogle/gemma-4-E2B-it.CI Test Execution (
pull_request.yml):python-buildjob to invokePYTHONPATH=. pipenv run pytest tests/ -v.unittestin minimal container compatibility checks (anomaly-training-checkandanomaly-serving-check) to keep deployment containers lean.Renovate Noise Reduction (
renovate.json):python-dev-toolspackage group forpytest,pylint, andyapfso that future dependency updates are bundled across all pipelines.Documentation & Skills:
AGENTS.mdand.agents/skills/dataflow-pipeline-dev/SKILL.mdto document running unit tests withpytest tests/ -v.README.mdfiles.Verification
ml_ai_python: 7/7 passed,anomaly_detection: 28/28 passed,marketing_intelligence: 8/8 passed).yapf --diff -r(0 diffs).pylint(10.00/10 score).python setup.py sdistsucceeded inml_ai_python.renovate.jsonwithjq.