Skip to content

Commit

Permalink
tests cover branches
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesstidard committed Mar 26, 2017
1 parent 7484b92 commit d7f350c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
branch = true
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ install:
- pip install -e .
- pip install -r requirements.txt
- pip install coveralls
script: pytest tests --cov=sanic_envconfig
script: pytest tests --cov-config .coveragerc
notifications:
email: false
after_success: coveralls
2 changes: 1 addition & 1 deletion sanic_envconfig/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import sys
import shlex
# import shlex

from typing import get_type_hints

Expand Down
6 changes: 6 additions & 0 deletions tests/test_envconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ def test_args_quoted(config, mock_args):
something_in_quotes = 'something in quotes'
mock_args(f'--attribute-str "{something_in_quotes}"')
assert config.ATTRIBUTE_STR == something_in_quotes


def test_normal_property_set(config, mock_env, sentinel):
mock_env({'normal': 'oh no'})
config.normal = sentinel
assert config.normal is sentinel

0 comments on commit d7f350c

Please sign in to comment.