Tests fails on clean clone
Closed this issue · 5 comments
I cannot get this plugin to work in vim, and when cloning the repo to test, I get a bunch of error messages.
Steps to reproduce:
mkvirtualenv vimtest
git clone https://github.com/JarrodCTaylor/vim-python-test-runner.git .
pip install --upgrade pip
pip install nose
nosetests
I would love to get this to work, so if I am doing something wrong, please advise me.
Output, when using python27:
(vimtest)Lasper@d025:/Users/Lasper/projects/vimtest$ nosetests
.EEE.............................................................
======================================================================
ERROR: autoload.vim_python_test_runner.write_test_command_to_cache_file
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/.virtualenvs/vimtest/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
TypeError: write_test_command_to_cache_file() takes exactly 1 argument (0 given)
======================================================================
ERROR: autoload.vim_python_test_runner.get_dot_notation_path_to_test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/.virtualenvs/vimtest/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
TypeError: get_dot_notation_path_to_test() takes exactly 1 argument (0 given)
======================================================================
ERROR: Failure: SyntaxError (invalid syntax (dummy_test_file.py, line 8))
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/.virtualenvs/vimtest/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/Users/Lasper/.virtualenvs/vimtest/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/Users/Lasper/.virtualenvs/vimtest/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/Users/Lasper/projects/vimtest/tests/dummy_test_file.py", line 8
strange.object.class()
^
SyntaxError: invalid syntax
----------------------------------------------------------------------
Ran 65 tests in 0.707s
FAILED (errors=3)
Output, when using python35:
(vimtest)Lasper@d025:/Users/Lasper/projects/vimtest$ nosetests
.EEE........EEE..EEEE.........EEEEEEEE.......EEEEEEEEE..EEEE..EEE
======================================================================
ERROR: autoload.vim_python_test_runner.write_test_command_to_cache_file
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/.virtualenvs/vimtest/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
TypeError: write_test_command_to_cache_file() missing 1 required positional argument: 'command'
======================================================================
ERROR: autoload.vim_python_test_runner.get_dot_notation_path_to_test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/.virtualenvs/vimtest/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
TypeError: get_dot_notation_path_to_test() missing 1 required positional argument: 'current_dir'
======================================================================
ERROR: Failure: SyntaxError (invalid syntax (dummy_test_file.py, line 8))
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/.virtualenvs/vimtest/lib/python3.5/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/Users/Lasper/.virtualenvs/vimtest/lib/python3.5/site-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/Users/Lasper/.virtualenvs/vimtest/lib/python3.5/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/Users/Lasper/.virtualenvs/vimtest/lib/python3.5/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/Users/Lasper/.virtualenvs/vimtest/lib/python3.5/imp.py", line 234, in load_module
return load_source(name, filename, file)
File "/Users/Lasper/.virtualenvs/vimtest/lib/python3.5/imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 658, in exec_module
File "<frozen importlib._bootstrap_external>", line 764, in get_code
File "<frozen importlib._bootstrap_external>", line 724, in source_to_code
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/Users/Lasper/projects/vimtest/tests/dummy_test_file.py", line 8
strange.object.class()
^
SyntaxError: invalid syntax
======================================================================
ERROR: test_get_command_to_run_current_class_when_current_line_occurs_in_file_more_than_once (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 318, in test_get_command_to_run_current_class_when_current_line_occurs_in_file_more_than_once
self.assertEqual(expected_return_value, sut.get_command_to_run_the_current_class(current_dir, current_line, current_buffer))
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 37, in get_command_to_run_the_current_class
class_name = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_current_class_when_tests_are_in_a_nested_directory (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 302, in test_get_command_to_run_current_class_when_tests_are_in_a_nested_directory
command_returned = sut.get_command_to_run_the_current_class(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 37, in get_command_to_run_the_current_class
class_name = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_current_class_writes_command_to_cache_file_when_successfully_called (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 361, in test_get_command_to_run_current_class_writes_command_to_cache_file_when_successfully_called
command_to_run = sut.get_command_to_run_the_current_class(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 37, in get_command_to_run_the_current_class
class_name = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_current_method_when_app_name_has_dots (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 384, in test_get_command_to_run_current_method_when_app_name_has_dots
command_returned = sut.get_command_to_run_the_current_method(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 44, in get_command_to_run_the_current_method
method_name = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_current_method_when_current_line_occurs_in_file_more_than_once (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 325, in test_get_command_to_run_current_method_when_current_line_occurs_in_file_more_than_once
self.assertEqual(expected_return_value, sut.get_command_to_run_the_current_method(current_dir, current_line, current_buffer))
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 44, in get_command_to_run_the_current_method
method_name = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_current_method_when_tests_are_in_a_nested_directory (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 310, in test_get_command_to_run_current_method_when_tests_are_in_a_nested_directory
command_returned = sut.get_command_to_run_the_current_method(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 44, in get_command_to_run_the_current_method
method_name = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_current_method_writes_command_to_cache_file_when_successfully_called (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 369, in test_get_command_to_run_current_method_writes_command_to_cache_file_when_successfully_called
command_to_run = sut.get_command_to_run_the_current_method(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 44, in get_command_to_run_the_current_method
method_name = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_class_when_config_not_present (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 189, in test_get_command_to_run_the_current_class_when_config_not_present
sut.get_command_to_run_the_current_class(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 37, in get_command_to_run_the_current_class
class_name = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_class_when_config_not_properly_formated_no_app_name (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 182, in test_get_command_to_run_the_current_class_when_config_not_properly_formated_no_app_name
sut.get_command_to_run_the_current_class(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 37, in get_command_to_run_the_current_class
class_name = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_class_when_manage_py_not_found (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 196, in test_get_command_to_run_the_current_class_when_manage_py_not_found
self.assertEqual("Not Django", sut.get_command_to_run_the_current_class(current_dir, current_line, current_buffer))
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 37, in get_command_to_run_the_current_class
class_name = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_class_when_multiple_apps_are_listed_and_a_valid_app_name_is_in_config_file (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 250, in test_get_command_to_run_the_current_class_when_multiple_apps_are_listed_and_a_valid_app_name_is_in_config_file
command_returned = sut.get_command_to_run_the_current_class(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 37, in get_command_to_run_the_current_class
class_name = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_class_when_multiple_apps_are_listed_and_a_valid_app_name_is_not_in_config_file (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 276, in test_get_command_to_run_the_current_class_when_multiple_apps_are_listed_and_a_valid_app_name_is_not_in_config_file
sut.get_command_to_run_the_current_class(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 37, in get_command_to_run_the_current_class
class_name = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_class_when_project_name_contains_the_app_name (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 332, in test_get_command_to_run_the_current_class_when_project_name_contains_the_app_name
command_returned = sut.get_command_to_run_the_current_class(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 37, in get_command_to_run_the_current_class
class_name = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_class_with_manage_py_app_name_and_env_specified (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 175, in test_get_command_to_run_the_current_class_with_manage_py_app_name_and_env_specified
self.assertEqual(expected_return_value, sut.get_command_to_run_the_current_class(current_dir, current_line, current_buffer))
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 37, in get_command_to_run_the_current_class
class_name = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_class_with_manage_py_app_name_but_no_env_specified (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 168, in test_get_command_to_run_the_current_class_with_manage_py_app_name_but_no_env_specified
self.assertEqual(expected_return_value, sut.get_command_to_run_the_current_class(current_dir, current_line, current_buffer))
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 37, in get_command_to_run_the_current_class
class_name = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_method_when_config_not_present (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 224, in test_get_command_to_run_the_current_method_when_config_not_present
sut.get_command_to_run_the_current_method(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 44, in get_command_to_run_the_current_method
method_name = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_method_when_config_not_properly_formated (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 217, in test_get_command_to_run_the_current_method_when_config_not_properly_formated
sut.get_command_to_run_the_current_method(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 44, in get_command_to_run_the_current_method
method_name = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_method_when_manage_py_not_found (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 231, in test_get_command_to_run_the_current_method_when_manage_py_not_found
sut.get_command_to_run_the_current_method(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 44, in get_command_to_run_the_current_method
method_name = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_method_when_multiple_apps_are_listed_and_a_valid_app_name_is_in_config_file (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 258, in test_get_command_to_run_the_current_method_when_multiple_apps_are_listed_and_a_valid_app_name_is_in_config_file
command_returned = sut.get_command_to_run_the_current_method(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 44, in get_command_to_run_the_current_method
method_name = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_method_when_multiple_apps_are_listed_and_a_valid_app_name_is_not_in_config_file (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 283, in test_get_command_to_run_the_current_method_when_multiple_apps_are_listed_and_a_valid_app_name_is_not_in_config_file
sut.get_command_to_run_the_current_method(current_dir, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 44, in get_command_to_run_the_current_method
method_name = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_method_with_manage_py_app_name_and_env_specified (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 210, in test_get_command_to_run_the_current_method_with_manage_py_app_name_and_env_specified
self.assertEqual(expected_return_value, sut.get_command_to_run_the_current_method(current_dir, current_line, current_buffer))
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 44, in get_command_to_run_the_current_method
method_name = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_command_to_run_the_current_method_with_manage_py_app_name_but_no_env_specified (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 203, in test_get_command_to_run_the_current_method_with_manage_py_app_name_but_no_env_specified
self.assertEqual(expected_return_value, sut.get_command_to_run_the_current_method(current_dir, current_line, current_buffer))
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 44, in get_command_to_run_the_current_method
method_name = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_current_method_and_class_returns_false_for_class_when_not_in_class (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 86, in test_get_current_method_and_class_returns_false_for_class_when_not_in_class
self.assertEqual(False, sut.get_current_method_and_class(2, current_buffer)[0])
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_current_method_and_class_returns_false_when_not_in_method (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 97, in test_get_current_method_and_class_returns_false_when_not_in_method
self.assertEqual(False, sut.get_current_method_and_class(25, current_buffer)[1])
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_valid_class_name (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 81, in test_get_valid_class_name
self.assertEqual("Example1", sut.get_current_method_and_class(current_line1, current_buffer)[0])
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_get_valid_method_name (tests.run_django_tests_in_vim_tests.VimTestRunnerForDjangoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_django_tests_in_vim_tests.py", line 92, in test_get_valid_method_name
self.assertEqual("dummy2", sut.get_current_method_and_class(should_return_dummy2, current_buffer)[1])
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_create_command_to_run_current_class_with_nosetests (tests.run_nosetests_in_vim_tests.RunNosetestsInVimTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_nosetests_in_vim_tests.py", line 25, in test_create_command_to_run_current_class_with_nosetests
command_to_run = sut.get_command_to_run_current_class_with_nosetests(path_to_current_file, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 59, in get_command_to_run_current_class_with_nosetests
current_class = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_create_command_to_run_current_class_with_nosetests_writes_command_to_cache_file_when_successfully_called (tests.run_nosetests_in_vim_tests.RunNosetestsInVimTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_nosetests_in_vim_tests.py", line 32, in test_create_command_to_run_current_class_with_nosetests_writes_command_to_cache_file_when_successfully_called
command_to_run = sut.get_command_to_run_current_class_with_nosetests(path_to_current_file, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 59, in get_command_to_run_current_class_with_nosetests
current_class = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_create_command_to_run_current_method_with_nosetests (tests.run_nosetests_in_vim_tests.RunNosetestsInVimTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_nosetests_in_vim_tests.py", line 40, in test_create_command_to_run_current_method_with_nosetests
command_to_run = sut.get_command_to_run_current_method_with_nosetests(path_to_current_file, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 66, in get_command_to_run_current_method_with_nosetests
run_class = get_command_to_run_current_class_with_nosetests(path_to_current_file, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 59, in get_command_to_run_current_class_with_nosetests
current_class = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_create_command_to_run_current_method_with_nosetests_when_not_in_a_class (tests.run_nosetests_in_vim_tests.RunNosetestsInVimTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_nosetests_in_vim_tests.py", line 55, in test_create_command_to_run_current_method_with_nosetests_when_not_in_a_class
command_to_run = sut.get_command_to_run_current_base_method_with_nosetests(path_to_current_file, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 75, in get_command_to_run_current_base_method_with_nosetests
current_method = get_current_method_and_class(current_line, current_buffer)[1]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
======================================================================
ERROR: test_create_command_to_run_current_method_with_nosetests_writes_command_to_cache_file_when_successfully_called (tests.run_nosetests_in_vim_tests.RunNosetestsInVimTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Lasper/projects/vimtest/tests/run_nosetests_in_vim_tests.py", line 47, in test_create_command_to_run_current_method_with_nosetests_writes_command_to_cache_file_when_successfully_called
command_to_run = sut.get_command_to_run_current_method_with_nosetests(path_to_current_file, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 66, in get_command_to_run_current_method_with_nosetests
run_class = get_command_to_run_current_class_with_nosetests(path_to_current_file, current_line, current_buffer)
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 59, in get_command_to_run_current_class_with_nosetests
current_class = get_current_method_and_class(current_line, current_buffer)[0]
File "/Users/Lasper/projects/vimtest/autoload/vim_python_test_runner.py", line 124, in get_current_method_and_class
for line in xrange(current_line_index - 1, -1, -1):
NameError: name 'xrange' is not defined
----------------------------------------------------------------------
Ran 65 tests in 0.809s
FAILED (errors=34)
There was a syntax error in the dummy_test_file
which I have now removed. In order to get the tests to run cd tests
and then run nosetests
using python 2.7
The syntax error in the test file should not have been preventing the plug-in from working, I use this plug-in every day. If you continue to have issues let me know, and we will get you sorted out.
When I run the :NosetestFile inside of test.py I get the output below.
The following is transcribed by hand (please excuse any typos):
:!nosetests /Users/Lasper/projects/china/test/test.py 2>&1 | tee /tmp/test_results.txt
. . . .
-------------------------------------
Ran 4 tests in 0.013s
OK
:!python :nosetests /Users/Lasper/projects/china/test/test.py 2>&1 | tee /tmp/test_results.txtnosetests /Users/Lasper/projects/china/test/test.py 2>&1 | tee /tmp/test_results.txt
python: can't open file ':nosetests': [Errno 2] No such file or directory
And then the contents of test.py disappears, and is replaced by the last line:
python: can't open file ':nosetests': [Errno 2] No such file or directory
I'm unclear on what you are showing here. What command are you running, Is there an example project?
I uploaded it here:
https://github.com/Laspimon/china
I activate the virtualenv.
Go to the root of the project.
Run "vim test/test.py"
Run ":NosetestFile"
I currently use the plug-in almost exclusively for Django projects. It does appear that there is an issue running it on projects only using nose. I will see if I can get it fixed up.