On 12/04/2021 13:53, kuba jamro wrote: > Thanks for the quick support on this. > > I've tried removing the __name__ == '__main__' and while that doesn't > fix the problem it does at least show that the script should not be run > in isolation. > > In the meantime I have found that if I debug the full set of tests then > I am able to debug the tests that I am interested in. While this works > it does have the following disadvantages; 1) It takes more time before > you are actually debugging the code you are interested in and 2) if you > are debugging a piece of code deep inside the project the breakpoints > could be hit from other tests and not just the ones of interest and 3) > this works by chance and given a change of execution, the failure could > be exposed again. > > 1) is not really a problem as the tests all complete very quickly > however 2) is a little annoying. It can be avoided by setting up > breakpoints in the tests of interest and using them as preconditions for > the actual breakpoints in the core of the project but this is fiddly to > set up. > > In any case, I've found a way to work around this so I don't need > anything to be fixed or changed right now.
As I reported before, both pytest and unittest allow to select which tests to run from the whole set. With pytest: python -m pytest beangulp/importers/csv_tests.py runs only the tests defined in csv_tests.py Cheer, Dan -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/a0ebaad3-89ca-de37-eaa2-bf65ba1d47bf%40grinta.net.