Skip to content

Commit

Permalink
start using doctests in test runs and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kalefranz committed Jan 15, 2017
1 parent 126dc67 commit 5302da0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ install:
build: false

test_script:
- py.test --cov conda --cov-report term-missing tests --shell=cmd.exe --shell=bash.exe
- py.test --cov conda --cov-report term-missing conda tests --shell=cmd.exe --shell=bash.exe

on_success:
- pip install codecov coveralls scrutinizer-ocular
Expand Down
19 changes: 15 additions & 4 deletions conda/common/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ def urlparse(url):


def url_to_s3_info(url):
"""
Convert a S3 url to a tuple of bucket and key
"""Convert an s3 url to a tuple of bucket and key.
Examples:
>>> url_to_s3_info("s3://bucket-name.bucket/here/is/the/key")
('bucket-name.bucket', '/here/is/the/key')
"""
parsed_url = parse_url(url)
assert parsed_url.scheme == 's3', "You can only use s3: urls (not %r)" % url
Expand Down Expand Up @@ -213,7 +216,7 @@ def is_windows_path(value):
@memoize
def get_proxy_username_and_pass(scheme):
username = input("\n%s proxy username: " % scheme)
passwd = getpass("Password:")
passwd = getpass("Password: ")
return username, passwd


Expand All @@ -224,7 +227,15 @@ def add_username_and_password(url, username, password):


def maybe_add_auth(url, auth, force=False):
"""add auth if the url doesn't currently have it"""
"""Add auth if the url doesn't currently have it.
By default, does not replace auth if it already exists. Setting ``force`` to ``True``
overrides this behavior.
Examples:
>>> maybe_add_auth("https://www.conda.io", "user:passwd")
'https://user:[email protected]'
"""
if not auth:
return url
url_parts = urlparse(url)._asdict()
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
norecursedirs = .* *.egg* build dist conda/_vendor/* conda_env/*
addopts =
--ignore setup.py
--ignore conda/__main__.py
--cov conda
--tb native
--strict
Expand Down
2 changes: 1 addition & 1 deletion utils/travis-run-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ main_test() {
echo $PYTHONHASHSEED

# basic unit tests
python -m pytest --cov-report xml --shell=bash --shell=zsh -m "not installed" tests
python -m pytest --cov-report xml --shell=bash --shell=zsh -m "not installed" conda tests
python setup.py --version

# activate tests
Expand Down

0 comments on commit 5302da0

Please sign in to comment.