Vitalije
On Fri, May 8, 2020 at 7:51 AM vitalije <[email protected]> wrote:
> As Brian suggested in another thread I have changed the strategy for
> performing hypothesis tests. Now test chooses a sequence of commands
> excluding undo and redo commands. After each command if the outline has
> changed, test will check to see if the undo really reverts the effect of
> command and then redo it again. Executing 5000 tests now takes about a
> minute. No bug has been found yet :-).
>
I wasn't necessarily recommending it as a replacement, but just as another
way. Conceivably the two different approaches could uncover different bugs.
But you are the one neck deep in the code and so are the one who can judge
what the best way is.
In order to get the pytest to work I had to save LeoPyRef.leo as
LeoPyRef.db. After that in commit 2560fe96a86, I get passing tests using
pytest. But with latest head (00bda92c), I'm getting error:
___________________________________________________________________________
test_select_and_commnads
____________________________________________________________________________
@settings(max_examples=5000, deadline=timedelta(seconds=4))
> @given(data())
def test_select_and_commnads(data):
leo/extensions/myleoqt.py:1488:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
leo/extensions/myleoqt.py:1490: in test_select_and_commnads
app = demo2_app()
leo/extensions/myleoqt.py:1365: in demo2_app
app.set_c(c)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
self = <leo.extensions.myleoqt.MyGUI object at 0x7fcc338d4eb0>, c =
<leo.extensions.myleoqt.DummyLeoController object at 0x7fcc34427490>
def set_c(self, c):
self.c = c
c.guiapi = self
self.redraw()
item = self.tree.currentItem()
> self.set_item(item, item)
E AttributeError: 'MyGUI' object has no attribute 'set_item'
leo/extensions/myleoqt.py:371: AttributeError
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/leo-editor/CAO5X8Cy%2B8E1BSm0zWUcDNwPB%2B26QzKTSzMmJwyUuwOtUCenWFw%40mail.gmail.com.