def test__mypy__invalid_not_enforcing(self): os.environ['PACKAGE_DIR'] = 'src' os.environ['TYPE_CHECK_ENFORCING'] = 'False' self.write_config_files(invalid_type_config) result = validate_type() self.assertEqual(result, 0)
def test__mypy__valid__mypy_args(self): os.environ['PACKAGE_DIR'] = 'src' os.environ['TYPE_CHECK_ENFORCING'] = 'True' os.environ['MYPY_ARGS'] = '--show-error-context' self.write_config_files(working_config) result = validate_type() self.assertEqual(result, 0)
def test__mypy__invalid_enforcing(self): os.environ['PACKAGE_DIR'] = 'src' os.environ['TYPE_CHECK_ENFORCING'] = 'True' self.write_config_files(invalid_type_config) result = validate_type() self.assertGreater(result, 0) self.assertTrue( os.path.exists( f'{self.artifacts_dir}/reports/{self.validator_name}/index.txt' ))
def test__mypy__invalid_enforcing_lxml_report(self): os.environ['PACKAGE_DIR'] = 'src' os.environ['TYPE_CHECK_ENFORCING'] = 'True' os.environ['TYPE_CHECK_REPORT_FORMAT'] = 'junit-xml' print(dumps(dict(os.environ), indent=4, sort_keys=True)) self.write_config_files(invalid_type_config) result = validate_type() self.assertGreater(result, 0) self.assertTrue( os.path.exists( f'{self.artifacts_dir}/reports/{self.validator_name}/mypy.xml') )
def test__mypy__valid__nopackage_dir__env(self): os.environ['TYPE_CHECK_ENFORCING'] = 'True' self.write_config_files(working_config) result = validate_type() self.assertEqual(result, 0)
def test__mypy__valid(self): os.environ['PACKAGE_DIR'] = 'src' os.environ['TYPE_CHECK_ENFORCING'] = 'True' self.write_config_files(working_config) result = validate_type() self.assertEqual(result, 0)