diff options
Diffstat (limited to 'test/command_callback/test_flake8_command_callback.vader')
-rw-r--r-- | test/command_callback/test_flake8_command_callback.vader | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/command_callback/test_flake8_command_callback.vader b/test/command_callback/test_flake8_command_callback.vader index 42afe65a..70527ad3 100644 --- a/test/command_callback/test_flake8_command_callback.vader +++ b/test/command_callback/test_flake8_command_callback.vader @@ -65,6 +65,41 @@ Execute(The flake8 callbacks should detect virtualenv directories): \ . ' --stdin-display-name %s -', \ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0']) +Execute(The FindProjectRoot should detect the project root directory for namespace package via Manifest.in): + silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_manifest/namespace/foo/bar.py') + + AssertEqual + \ fnameescape(g:dir . '/python_paths/namespace_package_manifest'), + \ ale#python#FindProjectRoot(bufnr('')) + +Execute(The FindProjectRoot should detect the project root directory for namespace package via setup.cf): + silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_setup/namespace/foo/bar.py') + + AssertEqual + \ fnameescape(g:dir . '/python_paths/namespace_package_setup'), + \ ale#python#FindProjectRoot(bufnr('')) + +Execute(The FindProjectRoot should detect the project root directory for namespace package via pytest.ini): + silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_pytest/namespace/foo/bar.py') + + AssertEqual + \ fnameescape(g:dir . '/python_paths/namespace_package_pytest'), + \ ale#python#FindProjectRoot(bufnr('')) + +Execute(The FindProjectRoot should detect the project root directory for namespace package via tox.ini): + silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_tox/namespace/foo/bar.py') + + AssertEqual + \ fnameescape(g:dir . '/python_paths/namespace_package_tox'), + \ ale#python#FindProjectRoot(bufnr('')) + +Execute(The FindProjectRoot should detect the project root directory for non-namespace package): + silent execute 'file ' . fnameescape(g:dir . '/python_paths/no_virtualenv/subdir/foo/bar.py') + + AssertEqual + \ fnameescape(g:dir . '/python_paths/no_virtualenv/subdir'), + \ ale#python#FindProjectRoot(bufnr('')) + " Some users currently run flake8 this way, so we should support it. Execute(Using `python -m flake8` should be supported for running flake8): silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') |