[Tarantool-patches] [PATCH v2 2/6] Fix luacheck warnings in test/

Sergey Bronnikov sergeyb at tarantool.org
Tue Apr 14 10:49:53 MSK 2020


On 18:54 Sat 11 Apr , Vladislav Shpilevoy wrote:
> Hi! Thanks for the patch!
> 
> > diff --git a/test/box/iproto_stress.result b/test/box/iproto_stress.result
> > index 7149d6c52..3b5b0a031 100644
> > --- a/test/box/iproto_stress.result
> > +++ b/test/box/iproto_stress.result
> > @@ -76,13 +76,13 @@ test_run:wait_cond(function() return n_workers == 0 end, 60)
> >  ---
> >  - true
> >  ...
> > -n_workers -- 0
> > +assert(n_workers == 0)
> 
> These changes should not be done, IMO. Most of our
> tests are diff based, and therefore it is ok to write
> a statement just to print it. It is not only simpler, but
> also allows to print the actual value, if it didn't match
> the expected value.

> For example, if n_workers becomes not 0, we would see its
> actual value in the diff. When we use assert(), we won't
> see anything except an error message 'assertion failed'.

I'm used to the language that has "smart" assertions that show
content compared by asserts. Like pytest -
https://docs.pytest.org/en/3.0.1/assert.html

Example:
	def test_function():
	>       assert f() == 4
	E       assert 3 == 4
	E        +  where 3 = f()

> I propose to allow writing non-functional statements in
> test/ dir.

removed previously added asserts

-- 
sergeyb@


More information about the Tarantool-patches mailing list