{"library":"skippy-cov","title":"Skippy-Cov","description":"Skippy-cov is a pytest plugin that intelligently selects and runs only relevant tests based on the current Git diff and previously collected coverage data. It aims to speed up CI/CD pipelines by avoiding unnecessary test runs by analyzing which code changes affect which tests. The current version is 0.2.2, with releases occurring periodically to refine its Git and pytest integration.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install skippy-cov"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"mkdir my_skippy_project && cd my_skippy_project\ngit init -b main\npip install skippy-cov pytest coverage\n\n# Create a simple module and test file\nmkdir src && mkdir src/tests\necho \"def func_a():\\n    return 'A'\\ndef func_b():\\n    return 'B'\" > src/my_module.py\necho \"import pytest\\nfrom src.my_module import func_a, func_b\\n\\ndef test_func_a():\\n    assert func_a() == 'A'\\n\\ndef test_func_b():\\n    assert func_b() == 'B'\" > src/tests/test_my_module.py\ntouch src/__init__.py src/tests/__init__.py\ngit add .\ngit commit -m \"Initial code and tests\"\n\necho \"\\n--- First run: Collect all coverage data ---\"\npytest --skippy-cov --cov=src --cov-report=xml src/tests/\n\n# Simulate a change to func_a and add a new test on a feature branch\ngit checkout -b feature/new-func\necho \"def func_a():\\n    return 'A_modified'\\ndef func_b():\\n    return 'B'\\ndef func_c():\\n    return 'C'\" > src/my_module.py\necho \"import pytest\\nfrom src.my_module import func_a, func_b, func_c\\n\\ndef test_func_a():\\n    assert func_a() == 'A_modified'\\n\\ndef test_func_func_b():\\n    assert func_b() == 'B'\\n\\ndef test_func_c():\\n    assert func_c() == 'C'\" > src/tests/test_my_module.py\ngit add .\ngit commit -m \"Add func_c and modify func_a\"\n\necho \"\\n--- Second run: Run only affected tests using diff ---\"\n# Generate a diff between 'main' branch and current 'feature/new-func' branch\ngit diff main...feature/new-func -- src/my_module.py > /tmp/my_skippy_diff.diff\npytest --skippy-cov=/tmp/my_skippy_diff.diff src/tests/\necho \"Expected: Only tests related to func_a (modified) and func_c (new) should run.\"\n","lang":"bash","description":"This quickstart demonstrates how to install skippy-cov, set up a minimal Git repository with a module and tests, run `pytest` to collect initial coverage data, then simulate code changes on a feature branch, and finally use `skippy-cov` with a Git diff to run only the affected tests.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}