Skip to content

Commit

Permalink
CONTRIBUTING.md: a couple more notes
Browse files Browse the repository at this point in the history
  • Loading branch information
havocp committed Jun 5, 2017
1 parent c396248 commit f070d07
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,25 @@ auto-fixes, fixing one thing could actually change the list of
problems you're iterating over. So the mechanism here may need
some massaging over time depending on what you're trying to do.

## Result objects

Often the code uses return values (such as the `Status` or
`PrepareResult` classes) to return error states, rather than
exceptions. These are easier to deal with when an error is
"expected" and may need to be processed by multiple layers of
code.

## Tests

CI enforces 100% test coverage, which is good because there are
lots of corner cases to worry about! You can modify Anaconda
Project with pretty good confidence because if you break it, the
tests will almost always break.

The main goal of 100% test coverage is to test error handling
codepaths, to be sure they work, and continue to work when
refactoring. 80%-ish coverage generally neglects error codepaths.

Tips for reaching 100% coverage on your new code:

* monkeypatch! Learn to use pytest's `monkeypatch` feature. Look
Expand All @@ -227,7 +239,7 @@ Always first think about important cases that need to work, write
those tests that seem logical, and then run the code coverage
analysis and add tests for anything you missed.

### Avoiding environment creation
### Avoiding environment creation in tests

Creating conda environments can be pretty slow, so you'll see a
lot of tests use a function called
Expand Down

0 comments on commit f070d07

Please sign in to comment.