Why are unit tests important in automated testing of machine learning code?
Think about testing small parts separately before combining them.
Unit tests focus on small parts of code to ensure each piece works correctly before integration.
Given a test file test_model.py with 3 passing tests and 1 failing test, what is the typical pytest summary output?
pytest test_model.py
Count how many tests passed and failed.
pytest reports the number of tests passed and failed after running.
Which pytest.ini configuration correctly sets the test path to tests/ and adds markers for ML tests?
Look for correct syntax and indentation in ini files.
Option D uses correct ini syntax with proper indentation and marker format.
ML tests sometimes pass and sometimes fail without code changes. What is the most likely cause?
Think about what causes unpredictable test results.
Randomness in data or model training without fixed seeds causes flaky tests.
Which sequence correctly describes an automated ML testing workflow in a CI/CD pipeline?
Think about logical order from code change to deployment.
The pipeline triggers on code push, runs tests, trains and validates model, then deploys if all pass.