Skip to content

Commit

Permalink
Merge pull request #48 from durden/master
Browse files Browse the repository at this point in the history
Skip django/flask tests if not installed
  • Loading branch information
pavlov99 committed Aug 6, 2016
2 parents f35f16b + ddcc862 commit 5605dc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 7 additions & 2 deletions jsonrpc/tests/test_backend_django/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
from __future__ import absolute_import
import os

from django.core.urlresolvers import RegexURLPattern
from django.test import TestCase
try:
from django.core.urlresolvers import RegexURLPattern
from django.test import TestCase
except ImportError:
import unittest
raise unittest.SkipTest('Django not found for testing')

from ...backend.django import JSONRPCAPI, api
import json

Expand Down
8 changes: 6 additions & 2 deletions jsonrpc/tests/test_backend_flask/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
else:
import unittest

# Flask is supported only for python2 and pyton3.3+
# Flask is supported only for python2 and python3.3+
if sys.version_info < (3, 0) or sys.version_info >= (3, 3):
from flask import Flask
try:
from flask import Flask
except ImportError:
raise unittest.SkipTest('Flask not found for testing')

from ...backend.flask import JSONRPCAPI, api

@api.dispatcher.add_method
Expand Down

0 comments on commit 5605dc5

Please sign in to comment.