Please test Leo's options code in devel

66 views
Skip to first unread message

Edward K. Ream

unread,
Jun 18, 2023, 8:13:23 AM6/18/23
to leo-editor
The latest revisions:

1. PR #3393, merged last night. TestLeoImport.test_recursive_import has been improved:

- The test uses a non-existent directory as the "dir_" arg, which should ensure that the test will work on any installation.
- The test exercises new asserts in ric.minimize_headline.

2. Rev a0952e, pushed a few minutes ago, This adds @path directives correctly and only if needed.

Please report any further problems. There is plenty of time for further tweaks.

Edward

Félix

unread,
Jun 18, 2023, 4:12:34 PM6/18/23
to leo-editor
(Good news first) After those changes on devel, the tests all pass now on my new windows machine under python 3.11. (which was the one with a failing test yesterday)

(bad news second) But, on my windows laptop, a single test now fails under python 3.9.
See this screenshot:
single-unit-test-fail-python396.png

This also happens on python 3.10.

 Also, under linux, an additional test fails. (In test_recursive_import, when it tries to see if a given path is an absolute path... probably a windows looking path like C:/something is given)

See those two tests in 3.9 and 3.10 screenshots below. (same failing tests on both.)
Screenshot from 2023-06-18 15-39-44.png
Screenshot from 2023-06-18 15-41-43.png

In other news, on leojs side of things, I went from 37 failing tests last week, to two (2) failing tests as of today. Probably going to release the first beta version pretty soon! 

Félix

Edward K. Ream

unread,
Jun 18, 2023, 8:45:03 PM6/18/23
to leo-e...@googlegroups.com
On Sun, Jun 18, 2023 at 3:12 PM Félix <felix...@gmail.com> wrote:
 
> ... single test now fails under python 3.9 [and 3.10]... Also, under linux, an additional test fails.

Thanks for the testing! I'll fix these immediately.

In other news, on leojs side of things, I went from 37 failing tests last week, to two (2) failing tests as of today. Probably going to release the first beta version pretty soon! 

Super news!!!

I assume that none of my recent work will affect leoJS, except for removing code that you would otherwise have had to look at :-)

I am working hard to fix all issues assigned to Leo 6.7.4. It looks like 6.7.4 is well ahead of schedule.

Edward

Edward K. Ream

unread,
Jun 18, 2023, 9:20:48 PM6/18/23
to leo-e...@googlegroups.com
On Sun, Jun 18, 2023 at 3:12 PM Félix <felix...@gmail.com> wrote:

Please review PR #3398. I've tested it on ubuntu and windows.

Edward

Thomas Passin

unread,
Jun 18, 2023, 10:09:05 PM6/18/23
to leo-editor
On Windows 10, python 3.11, pytest passes all tests.  python 3.10:

============================ warnings summary ============================
leo\plugins\leo_babel\tests\lib_test.py:118
  C:\Tom\git\leo-editor\leo\plugins\leo_babel\tests\lib_test.py:118: PytestCollectionWarning: cannot collect test class 'TestCmdr' because it has a __init__ constructor (from: leo/plugins/leo_babel/tests/lib_test.py)
    class TestCmdr:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================== short test summary info =========================
FAILED leo/unittests/core/test_leoAst.py::TestTOG::test_TryStar - AssertionError: make_tree failed
========== 1 failed, 851 passed, 1 skipped, 1 warning in 14.75s ==========

Python 3.9:
============================ warnings summary ============================
leo\plugins\leo_babel\tests\lib_test.py:118
  C:\Tom\git\leo-editor\leo\plugins\leo_babel\tests\lib_test.py:118: PytestCollectionWarning: cannot collect test class 'TestCmdr' because it has a __init__ constructor (from: leo/plugins/leo_babel/tests/lib_test.py)
    class TestCmdr:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================== short test summary info =========================
FAILED leo/unittests/core/test_leoAst.py::TestTOG::test_TryStar - Assert...
========== 1 failed, 850 passed, 2 skipped, 1 warning in 23.93s ==========


Build info:
Leo 6.7.4-devel, devel branch, build e58396da1b
2023-06-18 18:19:34 -0500
Python 3.11.4, PyQt version 6.4.3
Windows 10 AMD64 (build 10.0.19045) SP0

Thomas Passin

unread,
Jun 18, 2023, 10:20:59 PM6/18/23
to leo-editor
Python 3.11 on Manjaro Linux:

==================================== warnings summary ====================================
leo/plugins/leo_babel/tests/lib_test.py:118
  /home/tom/git/leo-editor/leo/plugins/leo_babel/tests/lib_test.py:118: PytestCollectionWarning: cannot collect test class 'TestCmdr' because it has a __init__ constructor (from: leo/plugins/leo_babel/tests/lib_test.py)
================================ short test summary info =================================
FAILED leo/unittests/core/test_leoImport.py::TestLeoImport::test_recursive_import - AssertionError
================== 1 failed, 851 passed, 1 skipped, 1 warning in 8.48s ===================


Leo 6.7.4-devel, devel branch, build e58396da1b
2023-06-18 18:19:34 -0500
Python 3.11.3, PyQt version 6.5.1
linux

Thomas Passin

unread,
Jun 18, 2023, 10:28:16 PM6/18/23
to leo-editor
Python 3.9 on Linux Mint:

  =============================== warnings summary =============================== leo/plugins/leo_babel/tests/lib_test.py:118 /home/tom/git/leo-editor/leo/plugins/leo_babel/tests/lib_test.py:118: PytestCollectionWarning: cannot collect test class 'TestCmdr' because it has a __init__ constructor (from: leo/plugins/leo_babel/tests/lib_test.py) class TestCmdr: -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED leo/unittests/core/test_leoAst.py::TestTOG::test_TryStar - AssertionError: make_tree failed FAILED leo/unittests/core/test_leoImport.py::TestLeoImport::test_recursive_import - AssertionError ============= 2 failed, 848 passed, 3 skipped, 1 warning in 10.39s =============

Leo 6.7.4-devel, devel branch, build e58396da1b
2023-06-18 18:19:34 -0500
Python 3.9.17, PyQt version 5.15.2
linux

Thomas Passin

unread,
Jun 18, 2023, 10:35:18 PM6/18/23
to leo-editor
Python 3.10 on Ubuntu:

=============================== warnings summary ===============================

leo/plugins/leo_babel/tests/lib_test.py:118

  /home/tom/git/leo-editor/leo/plugins/leo_babel/tests/lib_test.py:118: PytestCollectionWarning: cannot collect test class 'TestCmdr' because it has a __init__ constructor (from: leo/plugins/leo_babel/tests/lib_test.py)

    class TestCmdr:



-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

=========================== short test summary info ============================

FAILED leo/unittests/core/test_leoAst.py::TestTOG::test_TryStar - AssertionError: make_tree failed

FAILED leo/unittests/core/test_leoImport.py::TestLeoImport::test_recursive_import - AssertionError

============= 2 failed, 850 passed, 1 skipped, 1 warning in 11.32s =============

Leo 6.7.4-devel, tbp-tree branch, build e58396da1b

2023-06-18 18:19:34 -0500
Python 3.10.6, PyQt version 6.3.2
linux

Félix

unread,
Jun 18, 2023, 11:43:52 PM6/18/23
to leo-editor
I pulled latest devel on my windows 10 machine, All tests pass on python 3.11.

I then pulled the latest devel on my linux machine. tested in python 3.9 and 3.10. they both give the same two failed tests:
======================================================================
FAIL: test_TryStar (leo.unittests.core.test_leoAst.TestTOG)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/felix/leo-editor/leo/unittests/core/test_leoAst.py", line 1138, in test_TryStar
    self.make_data(contents)
  File "/home/felix/leo-editor/leo/unittests/core/test_leoAst.py", line 181, in make_data
    self.fail('make_tree failed')  # pragma: no cover
AssertionError: make_tree failed

======================================================================
FAIL: test_recursive_import (leo.unittests.core.test_leoImport.TestLeoImport)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/felix/leo-editor/leo/unittests/core/test_leoImport.py", line 105, in test_recursive_import
    x.minimize_headline(root)
  File "/home/felix/leo-editor/leo/core/leoImport.py", line 1785, in minimize_headline
    assert os.path.isabs(self.root_directory)
AssertionError

----------------------------------------------------------------------
Ran 853 tests in 6.481s

FAILED (failures=2, skipped=18)

(I'll report in a few minutes for results of testing on my other windows machine which has python 3.9 and 3.10.)

Félix

unread,
Jun 19, 2023, 12:02:30 AM6/19/23
to leo-editor
back, on windows I tried with python 3.9.6, this gives me a single test fail:
======================================================================
FAIL: test_TryStar (leo.unittests.core.test_leoAst.TestTOG)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\prog\leo-editor\leo\unittests\core\test_leoAst.py", line 1138, in test_TryStar
    self.make_data(contents)
  File "C:\prog\leo-editor\leo\unittests\core\test_leoAst.py", line 181, in make_data

    self.fail('make_tree failed')  # pragma: no cover
AssertionError: make_tree failed

----------------------------------------------------------------------
Ran 853 tests in 17.075s

FAILED (failures=1, skipped=20)

parse_ast: Syntax Error
[
     0: 'try:\n'
     1: "    print('a1')\n"
     2: "    print('a2')\n"
     3: 'except* ImportError:\n'
     4: "    print('b1')\n"
     5: "    print('b2')\n"
     6: 'except* SyntaxError:\n'
     7: "    print('c1')\n"
     8: "    print('c2')\n"
     9: 'else:\n'
    10: "    print('d1')\n"
    11: 'finally:\n'
    12: "    print('e1')\n"
    13: "    print('e2')\n"
]



Reply all
Reply to author
Forward
0 new messages