Skip to content

Commit

Permalink
test: add code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jayachithra committed Oct 2, 2024
1 parent 3462ff1 commit 7ddad52
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"extensions": [
"GitHub.copilot",
"ms-python.python",
"ms-dotnettools.csharp"
"ms-dotnettools.csharp",
"ryanluker.vscode-coverage-gutters"
]
}
}
Expand Down
18 changes: 18 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@ To run linting, run the following command:
poetry run ruff .
```

### Run tests

We use pytest to test our code, coverage.py to generate coverage reports and [coverage gutters](https://marketplace.visualstudio.com/items?itemName=semasquare.vscode-coverage-gutters#:~:text=Features.%20Supports%20any%20language%20as%20long%20as%20you) VSCode extension to visualize code coverage in the editor.

To run all tests and generate coverage data run the following command:

```bash
poetry run coverage run -m pytest .
```

This will generate a .coverage file. To visualize code coverage, generate a coverage.xml file from the .coverage file by running:

```bash
poetry run coverage xml
```

Once the xml file is generated, you can view the coverage results in the editor by running the `Coverage Gutters: Watch` command.

### Updating lock file

When updating Poetry's lock file your local cache can become outdated.
Expand Down

0 comments on commit 7ddad52

Please sign in to comment.