Submitter | Pierre-Yves David |
---|---|
Date | Sept. 7, 2019, 12:16 p.m. |
Message ID | <a8b6d502b98abcb4853d.1567858604@nodosa.octopoid.net> |
Download | mbox | patch |
Permalink | /patch/41534/ |
State | Accepted |
Headers | show |
Comments
On Sat, Sep 07, 2019 at 02:16:44PM +0200, Pierre-Yves David wrote: > diff --git a/tests/run-tests.py b/tests/run-tests.py > --- a/tests/run-tests.py > +++ b/tests/run-tests.py > @@ -1609,6 +1609,9 @@ class TTest(Test): > if exitcode != 0: > warnonly = WARN_NO > > + # `pos` is the key for the currently expected output it should match an > + # entry in `expected`. This `pos` is provided by "command" in the > + # output stream. These command are recognised using the `salt` That should be *on* entry. > pos = -1 > postout = [] > for out_rawline in output: > @@ -1628,6 +1631,7 @@ class TTest(Test): > optional = [] > for i, el in enumerate(els): > r = False > + assert el is None or bool(el) > if el: > r, exact = self.linematch(el, out_line) > if isinstance(r, str): Is this chunk intentional? Joerg
On 9/7/19 2:59 PM, Joerg Sonnenberger wrote: > On Sat, Sep 07, 2019 at 02:16:44PM +0200, Pierre-Yves David wrote: >> diff --git a/tests/run-tests.py b/tests/run-tests.py >> --- a/tests/run-tests.py >> +++ b/tests/run-tests.py >> @@ -1609,6 +1609,9 @@ class TTest(Test): >> if exitcode != 0: >> warnonly = WARN_NO >> >> + # `pos` is the key for the currently expected output it should match an >> + # entry in `expected`. This `pos` is provided by "command" in the >> + # output stream. These command are recognised using the `salt` > > That should be *on* entry. What do you mean ? That is should be "`pos` is the key for the currently expected output it should match on entry in expected?" > >> pos = -1 >> postout = [] >> for out_rawline in output: >> @@ -1628,6 +1631,7 @@ class TTest(Test): >> optional = [] >> for i, el in enumerate(els): >> r = False >> + assert el is None or bool(el) >> if el: >> r, exact = self.linematch(el, out_line) >> if isinstance(r, str): > > Is this chunk intentional? Oops, I forgot to split it out.
On Sun, Sep 08, 2019 at 10:05:39AM +0200, Pierre-Yves David wrote: > > > On 9/7/19 2:59 PM, Joerg Sonnenberger wrote: > > On Sat, Sep 07, 2019 at 02:16:44PM +0200, Pierre-Yves David wrote: > > > diff --git a/tests/run-tests.py b/tests/run-tests.py > > > --- a/tests/run-tests.py > > > +++ b/tests/run-tests.py > > > @@ -1609,6 +1609,9 @@ class TTest(Test): > > > if exitcode != 0: > > > warnonly = WARN_NO > > > + # `pos` is the key for the currently expected output it should match an > > > + # entry in `expected`. This `pos` is provided by "command" in the > > > + # output stream. These command are recognised using the `salt` > > > > That should be *on* entry. > > What do you mean ? That is should be "`pos` is the key for the currently > expected output it should match on entry in expected?" OK, ignore what I said. Joerg
Patch
diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1609,6 +1609,9 @@ class TTest(Test): if exitcode != 0: warnonly = WARN_NO + # `pos` is the key for the currently expected output it should match an + # entry in `expected`. This `pos` is provided by "command" in the + # output stream. These command are recognised using the `salt` pos = -1 postout = [] for out_rawline in output: @@ -1628,6 +1631,7 @@ class TTest(Test): optional = [] for i, el in enumerate(els): r = False + assert el is None or bool(el) if el: r, exact = self.linematch(el, out_line) if isinstance(r, str):