File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
+ import sys
3
+
2
4
from setuptools import setup
3
5
6
+ PY2 = sys .version_info .major == 2
4
7
5
8
project = "rdflib-sqlalchemy"
6
9
version = "0.3.8"
53
56
setup_requires = [
54
57
"nose>=1.3.6" ,
55
58
],
56
- tests_require = "coveralls" ,
59
+ tests_require = [
60
+ "coveralls"
61
+ ] + (['mock' ] if PY2 else []),
57
62
test_suite = "nose.collector" ,
58
63
entry_points = {
59
64
'rdf.plugins.store' : [
Original file line number Diff line number Diff line change 1
1
import unittest
2
- from unittest .mock import patch
2
+
3
+ try :
4
+ from unittest .mock import patch
5
+ except ImportError :
6
+ from mock import patch
3
7
4
8
from rdflib import (
5
9
ConjunctiveGraph ,
@@ -40,7 +44,7 @@ def test_success(self):
40
44
p .create_engine .assert_called_with ('sqlite://' , random_key = 'something' )
41
45
42
46
def test_no_url (self ):
43
- with patch ('rdflib_sqlalchemy.store.sqlalchemy' ) as p :
47
+ with patch ('rdflib_sqlalchemy.store.sqlalchemy' ):
44
48
with self .assertRaisesRegex (Exception , '.*url.*' ):
45
49
self .graph .open ({'random_key' : 'something' }, create = True )
46
50
You can’t perform that action at this time.
0 commit comments