fix: Resolve PyTest and linting errors on the build (#1060)

This commit is contained in:
John Vrbanac 2017-05-23 12:12:17 -07:00 committed by Kurt Griffiths
parent f1597d77e6
commit f7849a8ac5
2 changed files with 6 additions and 15 deletions

View File

@ -239,12 +239,12 @@ def test_request_cookie_parsing():
headers = [
(
'Cookie',
'''
"""
logged_in=no;_gh_sess=eyJzZXXzaW9uX2lkIjoiN2;
tz=Europe/Berlin; _ga=GA1.2.332347814.1422308165;
_gat=1;
_octo=GH1.1.201722077.1422308165
'''
"""
),
]

View File

@ -2,13 +2,11 @@
from datetime import datetime
import functools
import io
try:
import ujson as json
except ImportError:
import json
import random
import sys
import pytest
import six
@ -44,18 +42,11 @@ class TestFalconUtils(testtools.TestCase):
def old_thing():
pass
if six.PY3:
stream = io.StringIO()
else:
stream = io.BytesIO()
with pytest.warns(UserWarning) as rec:
old_thing()
old_stderr = sys.stderr
sys.stderr = stream
old_thing()
sys.stderr = old_stderr
self.assertIn(msg, stream.getvalue())
warn = rec.pop()
assert msg in str(warn.message)
def test_http_now(self):
expected = datetime.utcnow()