def test_cfgparser(self):
        sys.argv[1:] = [
            '--mutant-path',
            os.path.join(os.path.dirname(__file__), 'mock_modules'),
            os.path.join(os.path.dirname(__file__), 'mock_tests', '_test_cfgparser.py') + ':SafeConfigParserTestCase',
        ]
        main()

        buf_lines = self.parse_output(StringIO(self.output_buf.getvalue()))
        with open(os.path.join(os.path.dirname(__file__), 'mock_tests', '_test_cfgparser.output'), 'r') as fh:
            output_lines = self.parse_output(fh)

        diff_lines = list(difflib.unified_diff(output_lines, buf_lines, 'Expected Output', 'Test Output'))
        if diff_lines:
            assert not diff_lines, 'Test output is different\n\n' + ''.join(diff_lines)
    def test_cfgparser(self):
        sys.argv[1:] = [
            '--mutant-path',
            os.path.join(os.path.dirname(__file__), 'mock_modules'),
            os.path.join(os.path.dirname(__file__), 'mock_tests',
                         '_test_cfgparser.py') + ':SafeConfigParserTestCase',
        ]
        main()

        buf_lines = self.parse_output(StringIO(self.output_buf.getvalue()))
        with open(
                os.path.join(os.path.dirname(__file__), 'mock_tests',
                             '_test_cfgparser.output'), 'r') as fh:
            output_lines = self.parse_output(fh)

        diff_lines = list(
            difflib.unified_diff(output_lines, buf_lines, 'Expected Output',
                                 'Test Output'))
        if diff_lines:
            assert not diff_lines, 'Test output is different\n\n' + ''.join(
                diff_lines)
Beispiel #3
0
#python.exe -c "import nose; nose.main()"
#might need a pip install nose --update to refind paths
#nosetests --with-cov --cov .
from mutester.nose_main import main

if __name__ == '__main__':
    main()