diff --git a/.travis.yml b/.travis.yml index aa3db97..7288ce0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,4 +11,4 @@ env: - DAV_SERVER=owncloud REQUIREMENTS=release install: "./install-deps.sh" -script: "py.test tests/" +script: "py.test -l tests/" diff --git a/tests/test_utils.py b/tests/test_utils.py index ed34cac..d71b82e 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -42,9 +42,11 @@ def test_get_password_from_netrc(monkeypatch): return username, 'bogus', password import netrc - monkeypatch.setattr(netrc.netrc, 'authenticators', authenticators) + import getpass + monkeypatch.setattr(getpass, 'getpass', None) + _password = utils.get_password(username, resource) assert _password == password assert calls == [hostname] @@ -82,12 +84,15 @@ def test_get_password_from_system_keyring(monkeypatch, resources_to_test): import netrc netrc_calls = [] - def authenticators(self, h): - netrc_calls.append(h) + def authenticators(self, hostname): + netrc_calls.append(hostname) return None monkeypatch.setattr(netrc.netrc, 'authenticators', authenticators) + import getpass + monkeypatch.setattr(getpass, 'getpass', None) + _password = utils.get_password(username, resource) assert _password == password assert netrc_calls == [hostname]