File tree Expand file tree Collapse file tree 7 files changed +19
-20
lines changed Expand file tree Collapse file tree 7 files changed +19
-20
lines changed Original file line number Diff line number Diff line change 1
1
test :
2
- python setup.py test
2
+ pytest
3
3
coverage :
4
4
python -m coverage run -p --source=. setup.py test
5
5
cov-html :
Original file line number Diff line number Diff line change 1
1
msgpack-python >= 0.4.0
2
- pyyaml >= 3.10
Original file line number Diff line number Diff line change 38
38
39
39
# Test runner
40
40
# python setup.py test
41
- try :
42
- from tests .setup_command import test
43
- cmdclass ["test" ] = test
44
- except ImportError :
45
- pass
41
+ # try:
42
+ # from tests.setup_command import test
43
+ # cmdclass["test"] = test
44
+ # except ImportError:
45
+ # pass
46
46
47
47
48
48
def read (* parts ):
@@ -83,6 +83,5 @@ def find_version(*file_paths):
83
83
command_options = command_options ,
84
84
install_requires = [
85
85
'msgpack-python>=0.4' ,
86
- 'PyYAML>=3.10' ,
87
86
]
88
87
)
Original file line number Diff line number Diff line change 3
3
4
4
import collections
5
5
6
- import yaml
6
+ import json
7
7
import msgpack
8
8
9
9
from tarantool .const import (
@@ -221,12 +221,17 @@ def __str__(self):
221
221
:rtype: str or None
222
222
'''
223
223
if self .return_code :
224
- return yaml . dump ({
224
+ return json . dumps ({
225
225
'error' : {
226
226
'code' : self .strerror [0 ],
227
227
'reason' : self .return_message
228
228
}
229
- })
230
- return yaml .dump (self ._data )
229
+ }, sort_keys = True , indent = 4 )
230
+ output = []
231
+ for tpl in self ._data :
232
+ output .extend (("- " , json .dumps (tpl ), "\n " ))
233
+ if len (output ) > 0 :
234
+ output .pop ()
235
+ return '' .join (output )
231
236
232
237
__repr__ = __str__
Original file line number Diff line number Diff line change 5
5
import unittest
6
6
import setuptools
7
7
8
-
9
8
from glob import glob
10
9
11
10
class test (setuptools .Command ):
@@ -22,9 +21,7 @@ def run(self):
22
21
'''
23
22
Find all tests in test/tarantool/ and run them
24
23
'''
25
- #root = os.path.dirname(os.path.dirname(__file__))
26
- #sys.path.insert(0, root)
27
-
24
+
28
25
tests = unittest .defaultTestLoader .discover ('tests' )
29
26
test_runner = unittest .TextTestRunner (verbosity = 2 )
30
27
test_runner .run (tests )
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
3
- import yaml
4
3
import unittest
5
4
import tarantool
6
5
@@ -61,7 +60,7 @@ def test_00_02_fill_space(self):
61
60
[i , i % 5 , 'tuple_' + str (i )]
62
61
)
63
62
def test_00_03_answer_repr (self ):
64
- repr_str = """- [1, 1, tuple_1] \n """
63
+ repr_str = """- [1, 1, " tuple_1"] """
65
64
self .assertEqual (repr (self .con .select ('space_1' , 1 )), repr_str )
66
65
67
66
def test_02_select (self ):
Original file line number Diff line number Diff line change 7
7
envlist = py27, py36, pypy
8
8
9
9
[testenv]
10
- commands = python setup.py test
10
+ commands = pytest
11
11
deps =
12
12
pyyaml>=3.10
13
13
msgpack-python>=0.4.0
14
- six
14
+ pytest>=3.0.0
You can’t perform that action at this time.
0 commit comments