Closed willianrampazzo closed 4 years ago
Running with avocado run is still consistent:
@willianrampazzo:
I did some tests here, and unless I did something wrong, it is consistent:
Looking to your output here seems to me that it is consistent. The method test_foo_foo_foo_foo_bar()
it was called, or did miss something?
You asked to run tests that start with test_foo_foo_foo_foo
, and this should be both. Looking at your logs I can see that both were executed. Maybe I'm lost with too many foo, bars. :)
The problem might be the following: Since that you have if __name__ == '__main__'
this "parent job" is only executed when calling with python3
. Makes sense?
Running with avocado run is still consistent:
@willianrampazzo:
I did some tests here, and unless I did something wrong, it is consistent:
Looking to your output here seems to me that it is consistent. The method
test_foo_foo_foo_foo_bar()
it was called, or did miss something?You asked to run tests that start with
test_foo_foo_foo_foo
, and this should be both. Looking at your logs I can see that both were executed. Maybe I'm lost with too many foo, bars. :)The problem might be the following: Since that you have
if __name__ == '__main__'
this "parent job" is only executed when calling withpython3
. Makes sense?
Okay, after looking again at the tests I added here and your comment, I concluded Avocado uses the test reference as a regex, so test_foo
reference actually means test_foo*
. This may be a feature, but may confuse testers if they are starting with Avocado.
I looked at https://avocado-framework.readthedocs.io/en/80.0/guides/user/chapters/concepts.html#test-references and thought the explanation confusing. We should state somewhere that INSTRUMENTED
tests are resolved as test_*
.
So, maybe this issue should cover a document update.
More precisely, update the documentation here: https://avocado-framework.readthedocs.io/en/80.0/guides/user/chapters/concepts.html#instrumented to state how the tests are resolved.
@willianrampazzo I think that the first link you sent is the best place because talks about the references. I will submit a PR there.
Consider the following test:
With the following YAML file:
Running the test with
python3
oravocado run
works as desired ignoringtest_bar
as needed:Renaming the tests to something longer:
Running with
avocado run
is still consistent:Running with
pyhton3
it does not ignore the second test anymore: