I often run tests externally. Most of the time they are not really testing anything. They are just the way I can run externally python scripts which can have access to a lot of stuff without any import, and also can have some access to structured data. The same script would be much larger if used outside of Leo and also would require to be written in some file.It is also a must if one wishes to use leoBridge inside the test script.
Travis or any other continual integration tests need to be run externally don't they? Or does "run externally" mean something different than `python run_travis_unit_tests.py`?
Ran 925 tests in 21.108s
FAILED (failures=1, skipped=50)
Ran 938 tests in 25.360s
FAILED (errors=1, skipped=53)
Leo Log Window
Leo 6.1-devel, devel branch, build da55f3fbad
2019-10-06 16:53:59 -0500
Python 3.6.9, PyQt version 5.9.5
linux
2019-12-26 14:09:37 /pri/git/leo_bug_demos/unit_tests
$ ./*.py
setting leoID from os.getenv('USER'): 'bob'
found 1 doctests for leo.core.leoTest
found 2 doctests for leo.core.leoGlobals
g.app.old_gui_name: 'nullGui', g.app.gui.guiName(): nullGui
......
--global-docks: False
import-jupyter-notebook requires nbformat package
.ss................s........................
End of leoAtFile tests
...s..s.ssss.ss.....................................
End of leoColor tests
...............s......sss..
End of leoCommands tests
.........s..s.
End of leoConfig tests
....ss........................................................................s.........ssssssssss........................................................................s......s.....s.....sss..sss..
End of typing tests
.
End of leoEditCommands tests.
........
End of leoFileCommands tests.
.s.....s.s.....
End of leoFind tests.
.....s.
End of leoFrame tests.
...................................................................
End of leoGlobals tests.
.import-jupyter-notebook requires nbformat package
...............s..................................................................................................................................
End of leoImport tests.
.......
End of leoKeys tests.
.......................................
End of leoNodes tests.
....................ss..s..ss...Unexpected docutils exception
Traceback (most recent call last):
File "/pri/git/leo-editor/leo/core/leoRst.py", line 1630, in writeToDocutils
settings_overrides=overrides)
File "/usr/lib/python3/dist-packages/docutils/core.py", line 416, in publish_string
enable_exit_status=enable_exit_status)
File "/usr/lib/python3/dist-packages/docutils/core.py", line 664, in publish_programmatically
output = pub.publish(enable_exit_status=enable_exit_status)
File "/usr/lib/python3/dist-packages/docutils/core.py", line 219, in publish
output = self.writer.write(self.document, self.destination)
File "/usr/lib/python3/dist-packages/docutils/writers/__init__.py", line 80, in write
self.translate()
File "/pri/git/leo-editor/leo/plugins/leo_pdf.py", line 626, in translate
self.output = self.createPDF_usingPlatypus(story)
File "/pri/git/leo-editor/leo/plugins/leo_pdf.py", line 598, in createPDF_usingPlatypus
doc.build(story)
File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 1213, in build
BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker)
File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 995, in build
self._endBuild()
File "/usr/lib/python3/dist-packages/reportlab/platypus/doctemplate.py", line 930, in _endBuild
if getattr(self,'_doSave',1): self.canv.save()
File "/usr/lib/python3/dist-packages/reportlab/pdfgen/canvas.py", line 1237, in save
self._doc.SaveToFile(self._filename, self)
File "/usr/lib/python3/dist-packages/reportlab/pdfbase/pdfdoc.py", line 224, in SaveToFile
f.write(data)
TypeError: string argument expected, got 'bytes'
F.....................................................................
End of leoUndo tests.
..........................................................................................................................................................................
End of plugins unit tests
............s.....
all unit tests done
..
======================================================================
FAIL: runTest (leo.core.leoTest.GeneralTestCase)
@test c.rstCommands.writeToDocutils: pdf
----------------------------------------------------------------------
Traceback (most recent call last):
File "/pri/git/leo-editor/leo/core/leoTest.py", line 193, in runTest
exec(compile(script, scriptFile, 'exec'), d)
File "/home/bob/.leo/scriptFile.py", line 23, in <module>
assert result,result
AssertionError: None
----------------------------------------------------------------------
Ran 925 tests in 21.108s
FAILED (failures=1, skipped=50)
2019-12-26 14:11:42 /pri/git/leo_bug_demos/unit_tests
Leo 6.2-b1-devel, devel branch, build d7fb550b80
2019-12-24 13:56:02 -0500
Python 3.6.9, PyQt version 5.9.5
linux
2019-12-26 14:23:37 /pri/git/leo_bug_demos/unit_tests
$ ./unit_tests_bridge.py
setting leoID from os.getenv('USER'): 'bob'
found 1 doctests for leo.core.leoTest
found 2 doctests for leo.core.leoGlobals
g.app.old_gui_name: 'nullGui', g.app.gui.guiName(): nullGui
......
--global-docks: False
import-jupyter-notebook requires nbformat package
.ss.............
Running *all* unit tests...
.....sss........................
End of leoAtFile tests
....s..s....ssss.ss.....................................
End of leoColor tests
...............ss.....sss..
End of leoCommands tests
.........s..s.
End of leoConfig tests
....ss........................................................................s.........ssssssssss........................................................................s......s.....s.....sss..sss..
End of typing tests
.
End of leoEditCommands tests.
........
End of leoFileCommands tests.
.s.....s.s.....
End of leoFind tests.
.....s.
End of leoFrame tests.
.................................................................
End of leoGlobals tests.
.import-jupyter-notebook requires nbformat package
...............s..................................................................................................................................
End of leoImport tests.
.......
End of leoKeys tests.
.......................................
End of leoNodes tests.
....................ss..s..ss...E.....................................................................
End of leoUndo tests.
.........................................................................................................................................................................
End of plugins unit tests
............s.............
all unit tests done
..
======================================================================
ERROR: runTest (leo.core.leoTest.GeneralTestCase)
@test c.rstCommands.writeToDocutils: pdf
----------------------------------------------------------------------
Traceback (most recent call last):
File "/pri/git/leo-editor/leo/core/leoTest.py", line 198, in runTest
exec(compile(script, scriptFile, 'exec'), d)
File "/home/bob/.leo/scriptFile.py", line 16, in <module>
module = g.importFromPath(
AttributeError: module 'leo.core.leoGlobals' has no attribute 'importFromPath'
----------------------------------------------------------------------
Ran 938 tests in 25.360s
FAILED (errors=1, skipped=53)
2019-12-26 14:24:19 /pri/git/leo_bug_demos/unit_tests
$