I have build system that outputs log of running application and its tests being run. What bothers me, is that sublime just ignores prints if I add them in code. If I use logging to output something, then it works, but using prints for quick checks is much more convenient.
Is there an option to enable stdout/prints in panel, so it would not be ignored?
If I would run same command through terminal directly, then I can see prints.
So if let say in my code is this:
print "something..."
It is just ignored and I do not see in output panel.
command and whole build system config looks like this:
{
"shell_cmd": "python ~/openerp/scripts/odoo-run/run.py 10 -p 8079 --addons-path=~/odoo10/source/misc -d git_odoo -u project_task_sequence --test-enable",
"name": "Odoo Run",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"working_dir": "/home/oerp/odoo10/odoo/",
"syntax": "Packages/Makefile/Make Output.sublime-syntax",
}
In settings, the only thing I found that is related with output panel was this option: show_panel_on_build
, which is enabled.
Update
Snippet of code to show what results I get:
def test_sequence_number_1(self):
"""Test how sequences were generated."""
import logging
logger = logging.getLogger('Test')
logger.warn('This is outputed')
print "this is not outputed"
ProjectTask = self.env['project.task']
task_1 = ProjectTask.create({
'name': 'Task 1 (test)',
'project_id': self.project.id,
'generate_seq_number': True,
})
...
...
This is what I see in output panel through sublime:
...
...
2016-12-28 17:54:26,479 659 INFO git_odoo odoo.addons.project_task_sequence.tests.test_project_sequence: test_sequence_number_1 (odoo.addons.project_task_sequence.tests.test_project_sequence.TestProjectSequence)
2016-12-28 17:54:26,479 659 INFO git_odoo odoo.addons.project_task_sequence.tests.test_project_sequence: ` Test how sequences were generated.
2016-12-28 17:54:26,854 659 WARNING git_odoo Test: This is outputed
2016-12-28 17:54:27,271 659 INFO git_odoo odoo.addons.project_task_sequence.tests.test_project_sequence: test_sequence_number_2 (odoo.addons.project_task_sequence.tests.test_project_sequence.TestProjectSequence)
2016-12-28 17:54:27,271 659 INFO git_odoo odoo.addons.project_task_sequence.tests.test_project_sequence: ` Test sequence generation with custom task seq prefixes.
2016-12-28 17:54:27,616 659 INFO git_odoo odoo.addons.project_task_sequence.tests.test_project_sequence: Ran 2 tests in 1.137s
2016-12-28 17:54:27,616 659 INFO git_odoo odoo.addons.project_task_sequence.tests.test_project_sequence: OK
P.S. Though when I ran nosetests -s
command through sublime build system, then prints were outputted properly. Don't know why this one is different.