Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread Edward K. Ream
On Wed, Dec 8, 2021 at 2:21 PM vitalije wrote: > I've just merged PR 2353 in the devel > Excellent. 6.6 b2, cominging in a few days, will contain this work. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread vitalije
And the ENB is in another thread. On Wednesday, December 8, 2021 at 9:21:15 PM UTC+1 vitalije wrote: > I've just merged PR 2353 in the devel > > On Wednesday, December 8, 2021 at 9:17:16 PM UTC+1 Edward K. Ream wrote: > >> On Wed, Dec 8, 2021 at 2:14 PM vitalije wrote: >> >>> Done at 117a3bb52.

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread vitalije
I've just merged PR 2353 in the devel On Wednesday, December 8, 2021 at 9:17:16 PM UTC+1 Edward K. Ream wrote: > On Wed, Dec 8, 2021 at 2:14 PM vitalije wrote: > >> Done at 117a3bb52. >> >> It adds support for new configuration value `@bool >> put-class-in-imported-headlines` >> if this flag

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread Edward K. Ream
On Wed, Dec 8, 2021 at 2:14 PM vitalije wrote: > Done at 117a3bb52. > > It adds support for new configuration value `@bool > put-class-in-imported-headlines` > if this flag is True, then all imported class nodes have prepended `class > ` to their > headline. > Many thanks for this. I have just

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread vitalije
Done at 117a3bb52. It adds support for new configuration value `@bool put-class-in-imported-headlines` if this flag is True, then all imported class nodes have prepended `class ` to their headline. On Wednesday, December 8, 2021 at 8:10:48 PM UTC+1 Edward K. Ream wrote: > On Wednesday,

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread Edward K. Ream
On Wednesday, December 8, 2021 at 10:52:38 AM UTC-6 vitalije wrote: > Today, I've completely rewritten split_root function. This was necessary > to allow importing files from mypy repository. > Rev ee7ff9c51f8a7 successfully imports all python files from mypy > repository except one. > I've

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread Edward K. Ream
On Wed, Dec 8, 2021 at 10:52 AM vitalije wrote: > Today, I've completely rewritten split_root function. This was necessary > to allow importing files from mypy repository. > Rev ee7ff9c51f8a7 successfully imports all python files from mypy > repository except one. One of the files

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread vitalije
Today, I've completely rewritten split_root function. This was necessary to allow importing files from mypy repository. Rev ee7ff9c51f8a7 successfully imports all python files from mypy repository except one. One of the files (misc/upload-pypi.py) has a line in the comments that looks like

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread Edward K. Ream
On Wednesday, December 8, 2021 at 8:43:45 AM UTC-6 Edward K. Ream wrote: At rev 7b109931aa, the importer crashes for 81 mypy files. There is no indication elsewhere that the crash has occurred. There probably should be. All 81 failures have the same underlying cause, namely calls to

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread Edward K. Ream
On Mon, Dec 6, 2021 at 8:03 PM tbp1...@gmail.com wrote: > I just imported a Python file using the current devel branch (so not > Vitaije's new code). The file has a if __name__ == '__main__': section. > This section is located at the end of the imported file. I have no problem > with that

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread Edward K. Ream
On Wed, Dec 8, 2021 at 8:42 AM tbp1...@gmail.com wrote: > I used last night's import branch to import a file that has a lot of > decorators, and it seemed to work just as I would want. In particular, the > decorator statements were in the right places. > Good to know. Edward -- You received

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread Edward K. Ream
On Tue, Dec 7, 2021 at 2:10 PM vitalije wrote: > I've added more comments in the code and have created PR to merge > importers into devel branch. > Thanks for this. This is PR #2353 . I have assigned it to Leo 6.6. In general, I like what I

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread tbp1...@gmail.com
I used last night's import branch to import a file that has a lot of decorators, and it seemed to work just as I would want. In particular, the decorator statements were in the right places. On Wednesday, December 8, 2021 at 8:49:30 AM UTC-5 Edward K. Ream wrote: > On Tue, Dec 7, 2021 at

Re: For Vitalije: About unit tests for the python importer

2021-12-08 Thread Edward K. Ream
On Tue, Dec 7, 2021 at 12:09 PM vitalije wrote: > > A few more tests may be needed to get to 100% coverage. > > Done at 6282e76a62 in importers branch. Tests for python importer cover > 100% code, and all succeed. > Thank you! Edward -- You received this message because you are subscribed to

Re: For Vitalije: About unit tests for the python importer

2021-12-07 Thread vitalije
I've added more comments in the code and have created PR to merge importers into devel branch. Vitalije On Tuesday, December 7, 2021 at 7:09:40 PM UTC+1 vitalije wrote: > > A few more tests may be needed to get to 100% coverage. > > Done at 6282e76a62 in importers branch. Tests for python

Re: For Vitalije: About unit tests for the python importer

2021-12-07 Thread vitalije
> A few more tests may be needed to get to 100% coverage. Done at 6282e76a62 in importers branch. Tests for python importer cover 100% code, and all succeed. Vitalije -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this

Re: For Vitalije: About unit tests for the python importer

2021-12-07 Thread Edward K. Ream
On Tue, Dec 7, 2021 at 6:30 AM vitalije wrote: > Have you tried using pytest as a runner. Yes. g.run_coverage_tests uses pytest. But for "plain" testing (when finding out why tests fail) I prefer unittest. pytest appears to swallow traces, and I also prefer unittest's style of reporting.

Re: For Vitalije: About unit tests for the python importer

2021-12-07 Thread vitalije
On Tuesday, December 7, 2021 at 9:03:33 AM UTC+1 Edward K. Ream wrote: > > The assert* methods of unittest.TestCase provide better reports than > python's assert statement. > > Leo's existing test framework works well with the assert* methods, so the > conversion should be easy. > > Have you

Re: For Vitalije: About unit tests for the python importer

2021-12-07 Thread Edward K. Ream
On Mon, Dec 6, 2021 at 6:48 PM vitalije wrote: I've been working on new branch `importers` today. I just checked out the importers branch. It looks great! I've changed all methods to accept lines as input argument instead of text. > Good. The old tests were checking only on headlines... >

Re: For Vitalije: About unit tests for the python importer

2021-12-06 Thread tbp1...@gmail.com
I just imported a Python file using the current devel branch (so not Vitaije's new code). The file has a if __name__ == '__main__': section. This section is located at the end of the imported file. I have no problem with that location even though the older importer put it near the top. But

Re: For Vitalije: About unit tests for the python importer

2021-12-06 Thread vitalije
Sorry, I've missed your two posts. I've been working on new branch `importers` today. While looking at the importer pipeline, I've noticed several conversion text to lines and backwards. First split is in checking tabs and spaces, if there are mixed tabs and spaces, again text is turned into

Re: For Vitalije: About unit tests for the python importer

2021-12-06 Thread Edward K. Ream
On Monday, December 6, 2021 at 10:35:03 AM UTC-6 Edward K. Ream wrote: > I shall soon convert all tests so that they use check_headlines rather than the more verbose equivalent. Done in devel at rev c65459. In the tests I have marked headlines that should not be generated, or have poor