fix: Resolve PyTest and linting errors on the build (#1060)
This commit is contained in:
parent
f1597d77e6
commit
f7849a8ac5
|
@ -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
|
||||
'''
|
||||
"""
|
||||
),
|
||||
]
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue