Commit graph

65 commits

Author SHA1 Message Date
Tomas Janousek
57a5c405ea completion: Add omni completion for new task modstrings 2020-12-26 20:52:04 -05:00
Tomas Janousek
7b72ee47b9 syntax: Move setl foldtext to BufWinEnter autocmd
Vimwiki now resets fold{method,text} on BufWinEnter:

8d4cb7f11d/plugin/vimwiki.vim (L177)
8d4cb7f11d/plugin/vimwiki.vim (L325)

so we should do that as well otherwise we get overridden.

If the user actually configured vimwiki to use its folding, by setting
g:vimwiki_folding to something else than '' or 'custom', we should not
replace that. It would be nice if we could somehow augment
VimwikiFoldText and leave the rest intact, but we can't, so it's best to
keep off. Using foldmethod=syntax gets extremely laggy with just a few
hundreds of lines, so we must not force it.

Also, we now need to increase foldlevel in tests because the folding is
no longer being overridden in the default vimwiki configuration, so we'd
get closed folds in tests...
2020-12-18 17:55:09 -05:00
Tomas Janousek
7b67d510cc cache: Get markup_syntax from vimwiki, drop g:taskwiki_markup_syntax
I don't see the point of forcing the user to select this manually in
both vimwiki and taskwiki.
2020-09-18 11:31:49 -04:00
Tomas Janousek
15ce16f24c Revert "tests: Use explicit coverage tracking"
This reverts commit b00e886142.

This fixes reporting of coverage by the few tests that run outside of
vim.

The commit that is being reverted doesn't explain why it was committed,
and the git history suggests it was reverted once and then reintroduced
later again. None of those commits explains the why. I can only guess
that the last time this was committed was an attempt to fix coverage
reporting to outside of docker, which it didn't, and additionally it
made coverage gathering less robust (see previous commit). So this is
yet another fix for the inaccurate coverage reporting.

Or maybe it was because `--cov` without `=taskwiki` an argument reports
coverage for tests instead of taskwiki code? Nevermind, I guess, now it
works well.
2020-07-08 21:36:52 -04:00
Tomas Janousek
7d5b902c89 tests: Do not load vimwiki/taskwiki twice
Since c8c3cc9a00, vimwiki filetype is set
automatically by :edit, and `set filetype=vimwiki` loads everything
again.

One consequence of loading taskwiki twice is that
taskwiki/testcoverage.py is sourced twice, the Coverage object is
initialized, started, stopped and saved twice (with the same data
filename!) and the coverage report is inaccurate as two trackers write
into the same file.
2020-07-08 21:36:52 -04:00
Tomas Janousek
14c0268438 tests: Upgrade vimrunner and drop the now unnecessary hacks
This makes the tests less brittle and potentially also faster.
2020-07-02 09:51:56 -04:00
Tomas Janousek
4efe2c83d6 tests: Refactor the self.tasks resetting hack 2020-07-02 09:51:56 -04:00
Tomas Janousek
7f47669e0c tests: Run tests in parallel using pytest-xdist 2020-07-02 09:51:56 -04:00
Tomas Janousek
ae924a2afc tests: Drop unnecessary markup_syntax from MockCache 2020-07-02 09:51:56 -04:00
Tomas Janousek
6dd4d81aec tests: Use "default" syntax instead of "mediawiki" (for consistency) 2020-07-02 09:51:56 -04:00
Tomas Janousek
698e2448f3 tests: Fix vimwiki loading errors
Not only can we stop ignoring the errors, this also fixes
TestInfoActionNotTriggeredByEnterOnLink which would otherwise cause vim
to complain about g:vimwiki_wikilocal_vars not being available.
2020-07-02 09:51:56 -04:00
Tomas Janousek
789d04f488 tests: Catch vim errors in read_buffer
Without this, TestInfoActionNotTriggeredByEnterOnLink would pass because
it asserts that the buffer is empty, which is what read_buffer returned
if vim was stuck showing an error message. With `PYTEST_FLAGS=-s`, it
would additionally log

    E449: Invalid expression received: Send expression failed.

but that's easy to miss.
2020-07-02 09:51:56 -04:00
Tomas Janousek
9457b509cf tests: Simplify MultiSyntaxIntegrationTest.test_execute
Remove duplicated code.
2020-07-02 09:51:56 -04:00
Tomas Janousek
4e40a969f0 tests: Quit vim more reliably
`TestSuppressedMapping` leaves vim in visual mode and
`vimrunner.Client.quit()` fails with "E481: No range allowed" resulting
in

    Vim: Caught deadly signal TERM
    Vim: Finished.

This is probably harmless as the `quit()` is followed by `pkill`, but
let's do it the right way anyway.
2020-07-02 09:51:56 -04:00
Tomas Janousek
78105f4aca tests: Fix setting vim up twice
Since 8d8fd2c20b, the first `setup`
invocation sets g:taskwiki_markup_syntax="None" which is then detected
in `check_sanity` and vim is restarted, this time with correct
g:taskwiki_markup_syntax. This is wasteful and weird, but makes a bit of
sense as a hack to make `MultiSyntaxIntegrationTest` work as the
test_syntax fixture is not available in `setup`.

To fix this:

 * make `teardown` idempotent
 * let `check_sanity` fail early if the client is not set up yet
 * disable `setup` in `MultiSyntaxIntegrationTest`
 * let the sanity check and restart logic handle the setup in
   `MultiSyntaxIntegrationTest` once `markup` is available
2020-07-02 09:51:56 -04:00
Tomas Janousek
3edeef5960 tests: Report details about failed assertions in tests.base 2020-07-02 09:51:56 -04:00
Tomas Janousek
1cb822455c tests: Drop some (hopefully) unnecessary sleeps
vimrunner.Server.remote_expr waits for the result so we don't need to
sleep, except perhaps if vim does something asynchronously?
Anyway, this doesn't seem to break any tests here, and is noticeably
faster.
2020-07-02 09:51:56 -04:00
Tomas Janousek
c8c3cc9a00 tests: Fix misquoted g:vimwiki_list setting
vimrunner.Client.command doesn't do any escaping so we can only use
double quotes. Otherwise it does this:

    self.server.remote_expr(["VimrunnerPyEvaluateCommandOutput('let g:vimwiki_list = [{'syntax': 'mediawiki', 'ext': '.txt','path': '/tmp/tmpl1hh2nnf'}]')"])
    E449: Invalid expression received: Send expression failed.
2020-07-02 09:51:56 -04:00
Tomas Janousek
6609c541eb tests: Fix typo varialbes → variables 2020-07-02 09:51:56 -04:00
Tomas Janousek
c2627a14ad tests: Fix PEP 8 warnings in base.py 2020-07-02 09:51:56 -04:00
DancingQuanta
8d8fd2c20b Implemented multIi-markup tests in vim of viewport and preset 2018-10-18 01:00:29 -04:00
Tomas Babej
b00e886142
tests: Use explicit coverage tracking 2018-07-31 03:46:58 -04:00
Tomas Babej
3e615c27e3
tests: Provide more helpful message when looking for scripts 2018-07-15 18:26:30 -04:00
Tomas Babej
dfc2aef502
tests: Update list of script paths 2018-07-15 18:26:19 -04:00
Bodo Graumann
895b36d4d4 Test: Only kill gvim instances with custom name
Vimrunner-python allows to set a custom server name, which is used with
the `--servername` parameter for `gvim`. This way we can restrict the
killing of gvim instances to those, that we have used. For that purpose
we use the standard linux `pkill` utility instead of `killall`.
2017-07-31 00:54:08 +02:00
Bodo Graumann
8f51f2f4c2 main: Use one cache object for each buffer 2017-01-27 22:23:33 +01:00
Bodo Graumann
a22ad7e3cb tests: Allow running tests with en_GB locale 2017-01-27 10:55:01 +01:00
Bodo Graumann
ab4c7646a4 IntegrationTest: correctly retry start_client 2017-01-27 10:55:01 +01:00
Tomas Babej
4b55082413 tests: Test proper precise detection of vimwiki links 2017-01-11 11:17:39 +01:00
Tomas Babej
21b766134f coverage: Explicit coverage tracking no longer needed 2017-01-09 00:38:24 +01:00
Tomas Babej
2e402bf721 tests: base: Allow more unicode characters in the description during uuid matching 2017-01-07 23:35:21 +01:00
Tomas Babej
eff9d2164c tests: Provide more details when regex search fails 2017-01-06 12:09:30 +01:00
Tomas Babej
8eb10da06d Revert "Exaustive search for travis bug"
This reverts commit 8ebaa6d41a.

This experiment turned out to be a harder issue, so let's keep it off
the master branch.
2016-12-18 01:15:07 +01:00
Tomas Babej
8ebaa6d41a Exaustive search for travis bug 2016-12-17 01:08:14 +01:00
Tomas Babej
700680363d tests: Extend setup assertion for debugging 2016-12-16 17:37:33 +01:00
Tomas Babej
3f392a827a tests: Support testing vim under python3 2016-12-16 14:54:59 +01:00
Tomas Babej
dd0d4203f1 python3: Make tests work 2016-12-16 04:11:09 +01:00
Tomas Babej
29c6c1d29c python3: Use six.text_type instead direct unicode/str 2016-12-16 03:40:42 +01:00
Tomas Babej
cda27d960e BufferProxy: Fix wrong argument order 2016-04-20 19:02:20 +02:00
Tomas Babej
0d1a457506 tests: Amend tests with respect to BufferProxy introduction 2016-04-20 18:45:24 +02:00
Tomas Babej
90202b3f9d tests: Expand the MockCache with the real LineStore implementation 2015-12-26 13:19:47 +01:00
Tomas Babej
1b5a19924e tests: Refactor module mocks for parsing tests 2015-08-15 16:29:04 +02:00
Tomas Babej
fc0e9ea4be tests: Move MockCache to base module 2015-08-13 23:14:37 +02:00
Tomas Babej
82da710fd6 tests: Properly setup mocked vim instance 2015-08-11 20:36:07 +02:00
Tomas Babej
35dcf8f6d0 tests: Do not skip empty lines 2015-08-11 19:44:58 +02:00
Tomas Babej
62dbd9b5b4 tests: Fix typo in IntegrationTest setup 2015-08-11 19:44:45 +02:00
Tomas Babej
d73ead1bf7 tests: Add sanity check for fill_uuid matching only one task 2015-08-11 19:44:40 +02:00
Tomas Babej
ec00c961b4 tests: Allow unicode character ä in the task description 2015-08-10 14:30:12 +02:00
Tomas Babej
a63bb8b536 imports: Use tasklib public API directly 2015-08-09 16:19:00 +02:00
Tomas Babej
62edfe70ed tests: base: Create a regular real taskrc file for each test 2015-04-13 01:11:57 +02:00