Comments (3)
There are two bugs around.
With the following test suite:
import sys
import pytest
class TestA:
def testFoo(self):
assert False
def test_bar(self):
assert False
It can detect only one test method because the method is using camel-case naming convention:
✖ a_test.py
✖ TestA
? test_bar
which should be also detected, as in plain pytest runnre and in vim-test.
Also, when there is no test method detected in any either case, it should say informative some error message. Hope this helps. Or any message about progress -- e.g., test is running, has completed.
from vim-ultest.
For the first one, test pattern are specified in g:test#python#patterns
(or g:ultest_patterns
). This can be confirmed by checking:
echo ultest#adapter#get_patterns(CURRENT_FILE_NAME)
For python, we by default have test_
pattern, but this can be configured as follows:
let g:test#python#patterns = {
- \ 'test': ['\v^\s*%(async )?def (test_\w+)'],
+ \ 'test': ['\v^\s*%(async )?def (test\w+)'],
\ 'namespace': ['\v^\s*class (\w+)']
\}
It was not very obvious to figure out. It would be great to add some warning messages when no tests were detected, and/or execution of test operations.
from vim-ultest.
Hi thanks for looking into this.
For the first one, test pattern are specified in g:test#python#patterns (or g:ultest_patterns).
This is actually not correct, using g:ultest_patterns
is purely for runners which do not use pattern matching and so ultest needs custom patterns to find them. vim-test will not use these patterns to find the tests and so there will be inconsistency.
Also, when there is no test method detected in any either case, it should say informative some error message. Hope this helps. Or any message about progress -- e.g., test is running, has completed.
I don't think is necessary since the summary already shows what has been detected. There is no further information that vim-ultest can show.
For your actual problem of camel case names, this has come up before and there's nothing vim-ultest can do as this is a vim-test problem (See #39 (comment)).
To demonstrate this is vim-test you can use this file
def test_a():
assert True
def testB():
assert False
and run :TestNearest
on the last line. It will pass because it ran test_a
.
from vim-ultest.
Related Issues (20)
- Ultest not passing anything as parameters for rust HOT 16
- Can't scroll test results in pop-up HOT 3
- Set popup window height HOT 5
- Add C++ (GTest) or vim-gtest support HOT 8
- No notification handler registered HOT 7
- Does not allow passing arguments HOT 4
- UltestSummary broken after :bdelete buffer HOT 2
- Multi-line feature / do blocks are not detected
- Help: Tests running slower then vim-test HOT 2
- No module named 'termios' on Windows HOT 2
- Rust tests with mod names other that default 'mod tests' filtered out and not run. HOT 2
- Feature request: Use vim.notify HOT 3
- Awesome nvim / vim config, share please? HOT 2
- Feature request: Send to quickfix / Trouble HOT 1
- Add ability to run `UlTest` in sync HOT 3
- Error: vim-ultest encountered an unknown error on startup HOT 13
- Variable for Where to Split Buffer HOT 3
- No matching autocommands: UserUltestPositionsUpdate HOT 2
- Nested tests fail in Java JUnit HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-ultest.