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 11test :
2- python setup.py test
2+ pytest
33coverage :
44 python -m coverage run -p --source=. setup.py test
55cov-html :
Original file line number Diff line number Diff line change 11msgpack-python >= 0.4.0
2- pyyaml >= 3.10
Original file line number Diff line number Diff line change 3838
3939# Test runner
4040# 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
4646
4747
4848def read (* parts ):
@@ -83,6 +83,5 @@ def find_version(*file_paths):
8383 command_options = command_options ,
8484 install_requires = [
8585 'msgpack-python>=0.4' ,
86- 'PyYAML>=3.10' ,
8786 ]
8887)
Original file line number Diff line number Diff line change 33
44import collections
55
6- import yaml
6+ import json
77import msgpack
88
99from tarantool .const import (
@@ -221,12 +221,17 @@ def __str__(self):
221221 :rtype: str or None
222222 '''
223223 if self .return_code :
224- return yaml . dump ({
224+ return json . dumps ({
225225 'error' : {
226226 'code' : self .strerror [0 ],
227227 'reason' : self .return_message
228228 }
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 )
231236
232237 __repr__ = __str__
Original file line number Diff line number Diff line change 55import unittest
66import setuptools
77
8-
98from glob import glob
109
1110class test (setuptools .Command ):
@@ -22,9 +21,7 @@ def run(self):
2221 '''
2322 Find all tests in test/tarantool/ and run them
2423 '''
25- #root = os.path.dirname(os.path.dirname(__file__))
26- #sys.path.insert(0, root)
27-
24+
2825 tests = unittest .defaultTestLoader .discover ('tests' )
2926 test_runner = unittest .TextTestRunner (verbosity = 2 )
3027 test_runner .run (tests )
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
22
3- import yaml
43import unittest
54import tarantool
65
@@ -61,7 +60,7 @@ def test_00_02_fill_space(self):
6160 [i , i % 5 , 'tuple_' + str (i )]
6261 )
6362 def test_00_03_answer_repr (self ):
64- repr_str = """- [1, 1, tuple_1] \n """
63+ repr_str = """- [1, 1, " tuple_1"] """
6564 self .assertEqual (repr (self .con .select ('space_1' , 1 )), repr_str )
6665
6766 def test_02_select (self ):
Original file line number Diff line number Diff line change 77envlist = py27, py36, pypy
88
99[testenv]
10- commands = python setup.py test
10+ commands = pytest
1111deps =
1212 pyyaml>=3.10
1313 msgpack-python>=0.4.0
14- six
14+ pytest>=3.0.0
You can’t perform that action at this time.
0 commit comments