Move tests run by run_python_tests to tests/test_python

This commit is contained in:
Foo 2017-04-30 15:39:05 +03:00
parent 53a7d1046e
commit f3bf749467
14 changed files with 17 additions and 13 deletions

View File

@ -3,7 +3,7 @@
enter_suite python
for file in tests/test_*.py ; do
for file in tests/test_python/test_*.py ; do
test_name="${file##*/test_}"
if ! ${PYTHON} $file --verbose --catch ; then
fail "${test_name%.py}" F "Failed test(s) from $file"

View File

@ -840,7 +840,7 @@ class TestVim(TestCase):
@classmethod
def setUpClass(cls):
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'vim_sys_path')))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'vim_sys_path')))
@classmethod
def tearDownClass(cls):

View File

@ -704,7 +704,7 @@ class TestVCS(TestCase):
@classmethod
def setUpClass(cls):
cls.powerline_old_cwd = os.getcwd()
os.chdir(os.path.dirname(__file__))
os.chdir(os.path.dirname(os.path.dirname(__file__)))
call(['git', 'init', '--quiet', GIT_REPO])
assert os.path.isdir(GIT_REPO)
call(['git', 'config', '--local', 'user.name', 'Foo'], cwd=GIT_REPO)

View File

@ -9,7 +9,7 @@ from tests.modules import TestCase
from tests.modules.lib.fsconfig import FSTree
FILE_ROOT = os.path.join(os.path.dirname(__file__), 'cfglib')
FILE_ROOT = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'cfglib')
class LoadedList(list):

View File

@ -454,7 +454,7 @@ def setUpModule():
global __file__
old_cwd = os.getcwd()
__file__ = os.path.abspath(__file__)
os.chdir(os.path.dirname(__file__))
os.chdir(os.path.dirname(os.path.dirname(__file__)))
def tearDownModule():

View File

@ -46,7 +46,7 @@ def get_logger(stream=None):
class TestVimConfig(TestCase):
def test_vim(self):
from powerline.vim import VimPowerline
cfg_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'powerline', 'config_files')
cfg_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'powerline', 'config_files')
buffers = (
(('bufoptions',), {'buftype': 'help'}),
(('bufname', '[Command Line]'), {}),
@ -101,7 +101,7 @@ class TestVimConfig(TestCase):
@classmethod
def setUpClass(cls):
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'vim_sys_path')))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'vim_sys_path')))
@classmethod
def tearDownClass(cls):
@ -182,7 +182,7 @@ def setUpModule():
global saved_get_config_paths
import powerline
saved_get_config_paths = powerline.get_config_paths
path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'powerline', 'config_files')
path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'powerline', 'config_files')
powerline.get_config_paths = lambda: [path]
old_cwd = os.getcwd()

View File

@ -1291,7 +1291,11 @@ class TestVim(TestCase):
pl = Pl()
segment_info = vim_module._get_segment_info()
self.assertEqual(self.vim.file_size(pl=pl, segment_info=segment_info), '0 B')
with vim_module._with('buffer', os.path.join(os.path.dirname(__file__), 'empty')) as segment_info:
with vim_module._with(
'buffer',
os.path.join(
os.path.dirname(os.path.dirname(__file__)), 'empty')
) as segment_info:
self.assertEqual(self.vim.file_size(pl=pl, segment_info=segment_info), '0 B')
def test_file_opts(self):
@ -1599,7 +1603,7 @@ class TestVim(TestCase):
@classmethod
def setUpClass(cls):
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'vim_sys_path')))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'vim_sys_path')))
from powerline.segments import vim
cls.vim = vim
from powerline.segments.common import vcs
@ -1664,7 +1668,7 @@ def setUpModule():
global __file__
old_cwd = os.getcwd()
__file__ = os.path.abspath(__file__)
os.chdir(os.path.dirname(__file__))
os.chdir(os.path.dirname(os.path.dirname(__file__)))
def tearDownModule():

View File

@ -22,7 +22,7 @@ class TestVim(TestCase):
@classmethod
def setUpClass(cls):
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'vim_sys_path')))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'vim_sys_path')))
from powerline.selectors import vim
cls.vim = vim

View File

@ -231,7 +231,7 @@ old_cwd = None
def setUpModule():
global old_cwd
old_cwd = os.getcwd()
os.chdir(os.path.dirname(__file__))
os.chdir(os.path.dirname(os.path.dirname(__file__)))
os.mkdir(INOTIFY_DIR)