Skip to content

Commit

Permalink
Update test packages (#2918)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Aug 21, 2016
1 parent 635e5c8 commit f802d6b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
7 changes: 3 additions & 4 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
flake8>=2.6.0
flake8>=3.0.4
pylint>=1.5.6
astroid>=1.4.8
coveralls>=1.1
pytest>=2.9.2
pytest-cov>=2.2.1
pytest-cov>=2.3.1
pytest-timeout>=1.0.0
pytest-capturelog>=0.7
pytest-catchlog>=1.2.2
pydocstyle>=1.0.0
requests_mock>=1.0
mypy-lang>=0.4
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[wheel]
universal = 1

[pytest]
[tool:pytest]
testpaths = tests
norecursedirs = .git testing_config

Expand Down
12 changes: 6 additions & 6 deletions tests/components/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ def test_access_denied_with_wrong_password_in_header(self):
def test_access_with_password_in_header(self, caplog):
"""Test access with password in URL."""
# Hide logging from requests package that we use to test logging
caplog.setLevel(logging.WARNING,
logger='requests.packages.urllib3.connectionpool')
caplog.set_level(logging.WARNING,
logger='requests.packages.urllib3.connectionpool')

req = requests.get(
_url(const.URL_API),
headers={const.HTTP_HEADER_HA_AUTH: API_PASSWORD})

assert req.status_code == 200

logs = caplog.text()
logs = caplog.text

# assert const.URL_API in logs
assert API_PASSWORD not in logs
Expand All @@ -99,15 +99,15 @@ def test_access_denied_with_wrong_password_in_url(self):
def test_access_with_password_in_url(self, caplog):
"""Test access with password in URL."""
# Hide logging from requests package that we use to test logging
caplog.setLevel(logging.WARNING,
logger='requests.packages.urllib3.connectionpool')
caplog.set_level(logging.WARNING,
logger='requests.packages.urllib3.connectionpool')

req = requests.get(_url(const.URL_API),
params={'api_password': API_PASSWORD})

assert req.status_code == 200

logs = caplog.text()
logs = caplog.text

# assert const.URL_API in logs
assert API_PASSWORD not in logs
Expand Down

0 comments on commit f802d6b

Please sign in to comment.