GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - keploy/python-sdk

BranchesTags
Open more actions menu

Latest commit

 

History

31 Commits
31 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
keploy-pytest
keploy-pytest
 
 
scripts
scripts
 
 
src/keploy_agent
src/keploy_agent
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
pyproject.toml
pyproject.toml
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

Keploy Python Coverage Agent

The Keploy Python Coverage Agent is a lightweight, sidecar module designed to integrate with the Keploy integration testing platform (enterprise version). When imported into a Python application, it enables Keploy to capture and report code coverage on a per-test-case basis.

Installation and Usage

Follow these steps to integrate the coverage agent into your Python project.

Step 1: Install the Agent

Install the keploy-agent package from PyPI into your virtual environment:

pip install keploy-agent

If you are developing the agent, install it in editable mode from a checkout of this repository instead:

pip install -e /path/to/python-sdk

Step 2: Integrate into Your Application

To enable coverage tracking, import the keploy_agent module at the very top of your application's main entry point file (e.g., app.py, main.py).

It is crucial that this is one of the first imports, as this ensures the agent is initialized before your application code begins to execute.

Example app.py:

import keploy_agent  # <-- Add this line at the top
import os
from flask import Flask

app = Flask(__name__)

@app.get("/")
def hello():
    # This function will be tracked by the coverage agent
    # when its endpoint is hit during a Keploy test.
    return "Hello, World!"

if __name__ == "__main__":
    app.run()

Step 3: Run with Keploy

Now, you can run your application tests using the Keploy CLI. The agent will automatically connect with Keploy.

sudo -E keploy-enterprise test -c "python3 app.py" --language python --dedup

Now you will see dedupData.yaml getting created.

Run sudo -E keploy-enterprise dedup to get the tests which are duplicate in duplicates.yaml file

In order to remove the duplicate tests, run the following command:

sudo -E keploy-enterprise dedup --rm

About

No description, website, or topics provided.

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

13 stars

Watchers

1 watching

Forks

9 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

Generated from keploy/template
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.