Skip to content

Commit

Permalink
Nodupe unit tests (#697)
Browse files Browse the repository at this point in the history
* Added many more NoDupe tests

* Add final tests to nodupe

* Add nodupe sub-class tests

* Add test docs on using VSCode
  • Loading branch information
gcglinton authored Jun 19, 2023
1 parent 23cf36a commit ef68615
Show file tree
Hide file tree
Showing 4 changed files with 700 additions and 38 deletions.
25 changes: 25 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,31 @@ Code coverage can be generated by adding `--cov-config=tests/.coveragerc --cov=s

Junit-compatible unit test report can be had with by adding `--junitxml=tests/junit/test-results.xml` to the command-line.

### Visual Studio Code

If you want to run this in VSCode, and have it do all the things nicely, you'll need the following extensions:
- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
Provides all the smarts for Python development (IntelliSense, linting, debugging, code formatting, refactoring, unit tests, etc..)
- [Coverage Gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters)
Provides a way to track code coverage in VSCode
- [Python Environment Manager](https://marketplace.visualstudio.com/items?itemName=donjayamanne.python-environment-manager)
Not strictly required, but really handy if you're working on a number of Python projects
- [GitLens — Git supercharged](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)
Not strictly required, but *very* strongly recommended as it makes VS Code's git features fully functional

Beyond that, changing a few options in your settings file will make it all work; thusly:
```json
{
"python.testing.pytestArgs": [
"tests", "-v",
"--cov-config=tests/.coveragerc", "--cov=sarracenia", "--cov-report=xml", "--cov-report=html",
"--failed-dependency-action=run", "--missing-dependency-action=run"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"coverage-gutters.coverageBaseDir": "tests/coverage",
}
```

## Docker
You can also run the exact same tests from within a Docker container if you want to avoid having to (re)-provision clean installs.
Expand Down
Loading

0 comments on commit ef68615

Please sign in to comment.