示例#1
0
 def test_flake8_conformance(self):
     with capture_stdout() as captor:
         flake8_style = get_style_guide(paths=[settings.BASE_DIR])
         report = flake8_style.check_files()
     if report.total_errors > 0:
         self.fail(
             'Got some flake8 errors:\n{0}'.format(captor['value']),
         )
示例#2
0
 def test_flake8_conformance(self):
     with capture_stdout() as captor:
         flake8_style = get_style_guide(paths=[settings.BASE_DIR])
         report = flake8_style.check_files()
     if report.total_errors > 0:
         self.fail('Got some flake8 errors:\n{0}'.format(captor['value']), )
示例#3
0
 def test_stdout_capturing(self):
     with capture_stdout() as captor:
         print('oh hi')  # NOQA
     self.assertEqual(captor['value'], 'oh hi\n')