Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Travis build errors #328

Merged
merged 6 commits into from
Feb 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ rollbar.egg-info/
Pipfile
Pipfile.lock
.pytest_cache/
.python-version
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ matrix:
- python: "2.7"
env: FLASK_VERSION=1.0.2
- python: "3.3"
dist: trusty
env: FLASK_VERSION=0.10.1
- python: "3.3"
dist: trusty
env: FLASK_VERSION=0.11.1
- python: "3.3"
dist: trusty
env: FLASK_VERSION=0.12.4
- python: "3.3"
dist: trusty
env: FLASK_VERSION=1.0.2
- python: "3.4"
env: FLASK_VERSION=0.10.1
Expand Down Expand Up @@ -76,8 +80,10 @@ matrix:
env: DJANGO_VERSION=1.11.20

- python: "3.3"
dist: trusty
env: DJANGO_VERSION=1.6.11
- python: "3.3"
dist: trusty
env: DJANGO_VERSION=1.8.19

- python: "3.4"
Expand Down Expand Up @@ -127,6 +133,8 @@ matrix:
env: PYRAMID_VERSION=1.9.2

install:
- pip install setuptools==39.2.0 --force-reinstall
- if [ $TRAVIS_PYTHON_VERSION == 3.3 ]; then pip install Werkzeug==0.14.1 --force-reinstall; fi
- if [ -v FLASK_VERSION ]; then pip install Flask==$FLASK_VERSION; fi
- if [ -v TWISTED_VERSION ]; then pip install Twisted==$TWISTED_VERSION treq; fi
- if [ -v DJANGO_VERSION ]; then pip install Django==$DJANGO_VERSION; fi
Expand Down
26 changes: 23 additions & 3 deletions rollbar/test/flask_tests/test_flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
import sys
import os

import mock
try:
from unittest import mock
except ImportError:
import mock

import rollbar

from rollbar.test import BaseTest
Expand Down Expand Up @@ -98,7 +102,15 @@ def test_uncaught(self, send_payload):

self.assertIn('request', data)
self.assertEqual(data['request']['url'], 'http://localhost/cause_error?foo=bar')
self.assertDictEqual(data['request']['GET'], {'foo': ['bar']})

# The behavior of implicitly converting werkzeug.ImmutableMultiDict
# using dict() changes starting in Python 3.6.
# See _build_werkzeug_request_data()
if sys.version_info >= (3, 6):
self.assertDictEqual(data['request']['GET'], {'foo': 'bar'})
else:
self.assertDictEqual(data['request']['GET'], {'foo': ['bar']})

self.assertEqual(data['request']['user_ip'], '1.2.3.4')
self.assertEqual(data['request']['method'], 'GET')
self.assertEqual(data['request']['headers']['User-Agent'], 'Flask Test')
Expand Down Expand Up @@ -153,7 +165,15 @@ def test_uncaught_no_username_no_email(self, send_payload):

self.assertIn('request', data)
self.assertEqual(data['request']['url'], 'http://localhost/cause_error?foo=bar')
self.assertDictEqual(data['request']['GET'], {'foo': ['bar']})

# The behavior of implicitly converting werkzeug.ImmutableMultiDict
# using dict() changes starting in Python 3.6.
# See _build_werkzeug_request_data()
if sys.version_info >= (3, 6):
self.assertDictEqual(data['request']['GET'], {'foo': 'bar'})
else:
self.assertDictEqual(data['request']['GET'], {'foo': ['bar']})

self.assertEqual(data['request']['user_ip'], '1.2.3.4')
self.assertEqual(data['request']['method'], 'GET')
self.assertEqual(data['request']['headers']['User-Agent'], 'Flask Test')
Expand Down
6 changes: 5 additions & 1 deletion rollbar/test/test_loghandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
import copy
import json
import logging
import mock
import sys

try:
from unittest import mock
except ImportError:
import mock

import rollbar
from rollbar.logger import RollbarHandler

Expand Down
5 changes: 4 additions & 1 deletion rollbar/test/test_pyramid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import mock
try:
from unittest import mock
except ImportError:
import mock

from rollbar.test import BaseTest

Expand Down
6 changes: 5 additions & 1 deletion rollbar/test/test_rollbar.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import base64
import copy
import json
import mock
import socket
import threading
import uuid

import sys

try:
from unittest import mock
except ImportError:
import mock

try:
from StringIO import StringIO
except ImportError:
Expand Down
6 changes: 5 additions & 1 deletion rollbar/test/twisted_tests/test_twisted.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
import json
import sys

import mock
try:
from unittest import mock
except ImportError:
import mock

import rollbar

# access token for https://rollbar.com/rollbar/pyrollbar
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
VERSION = re.search(r"^__version__ = ['\"]([^'\"]+)['\"]", INIT_DATA, re.MULTILINE).group(1)

tests_require = [
'mock',
'webob',
'blinker',
'unittest2'
]

version = sys.version_info
if version[0] == 2 or (version[0] == 3 and version[1] < 4):
tests_require.append('mock<=3.0.5') # mock > 3.0.5 requires python >= 3.5
tests_require.append('enum34')

setup(
Expand Down