diff --git a/ycmd/tests/get_completions_test.py b/ycmd/tests/get_completions_test.py index 4904fc64f5..4b94415593 100644 --- a/ycmd/tests/get_completions_test.py +++ b/ycmd/tests/get_completions_test.py @@ -26,7 +26,6 @@ standard_library.install_aliases() from builtins import * # noqa -import os from hamcrest import assert_that, equal_to, has_items, contains_string from mock import patch from nose.tools import eq_ diff --git a/ycmd/tests/identifier_completer_test.py b/ycmd/tests/identifier_completer_test.py index c6bc915aaa..80af122841 100644 --- a/ycmd/tests/identifier_completer_test.py +++ b/ycmd/tests/identifier_completer_test.py @@ -29,17 +29,10 @@ from ycmd.completers.all import identifier_completer as ic from ycmd.completers.all.identifier_completer import IdentifierCompleter from ycmd.request_wrap import RequestWrap +from ycmd.tests import PathToTestFile from ycmd.tests.test_utils import BuildRequest -TEST_DIR = os.path.dirname( os.path.abspath( __file__ ) ) -DATA_DIR = os.path.join( TEST_DIR, - '..', '..', - 'cpp', 'ycm', - 'tests', - 'testdata' ) - - def BuildRequestWrap( contents, column_num, line_num = 1 ): return RequestWrap( BuildRequest( column_num = column_num, line_num = line_num, @@ -166,7 +159,7 @@ def FilterUnchangedTagFiles_SkipBadFiles_test(): def FilterUnchangedTagFiles_KeepGoodFiles_test(): ident_completer = IdentifierCompleter( DefaultOptions() ) - tag_file = os.path.join( DATA_DIR, 'basic.tags' ) + tag_file = PathToTestFile( 'basic.tags' ) eq_( [ tag_file ], list( ident_completer._FilterUnchangedTagFiles( [ tag_file ] ) ) ) @@ -175,7 +168,7 @@ def FilterUnchangedTagFiles_SkipUnchangesFiles_test(): ident_completer = IdentifierCompleter( DefaultOptions() ) # simulate an already open tags file that didn't change in the meantime. - tag_file = os.path.join( DATA_DIR, 'basic.tags' ) + tag_file = PathToTestFile( 'basic.tags' ) ident_completer._tags_file_last_mtime[ tag_file ] = os.path.getmtime( tag_file )