Add a comment on why the unit test was removed.
@@ -116,27 +116,34 @@ class TestTripleGeneration(unittest.TestCase):
p = Path('data/Q57160439_not_truthy_tmp.ttl')
p.unlink()
- def test_triple_small_values(self):
- small_values_file = Path('data/small_values.tsv')
- wikidata_property_file = 'data/wikidata_properties.tsv'
- o = 'data/small_values_tmp.ttl'
- generator = TripleGenerator(prop_file=wikidata_property_file, label_set='label', alias_set='aliases',
- description_set='descriptions', warning=True, n=100, truthy=True, use_id=True,
- dest_fp=o, log_path="data/warning.log", prop_declaration=False, prefix_path="NONE",
- input_file=small_values_file, error_action='log')
- generator.process()
- with open('data/small_values.ttl') as f1:
- f1_lines = f1.readlines()
- with open('data/small_values_tmp.ttl') as f2:
- f2_lines = f2.readlines()
- self.assertEqual(f1_lines, f2_lines)
-
- self.assertEqual(os.stat("data/warning.log").st_size, 0)
- p = Path("data/warning.log")
- p.unlink()
- p = Path('data/small_values_tmp.ttl')
- p.unlink()
+ # 11-Oct-2021: This unit test was commented out because it generates
+ # floating point numbers which appear not to be represented stably:
+ # somtimes written with an exponent, sometimes without. There is no change
+ # in the numeric value, but the change in string representation causes
+ # the test, as written, to sometimes fail.
+ #
+ # def test_triple_small_values(self):
+ # small_values_file = Path('data/small_values.tsv')
+ # wikidata_property_file = 'data/wikidata_properties.tsv'
+ # o = 'data/small_values_tmp.ttl'
+ # generator = TripleGenerator(prop_file=wikidata_property_file, label_set='label', alias_set='aliases',
+ # description_set='descriptions', warning=True, n=100, truthy=True, use_id=True,
+ # dest_fp=o, log_path="data/warning.log", prop_declaration=False, prefix_path="NONE",
+ # input_file=small_values_file, error_action='log')
+ # generator.process()
+ #
+ # with open('data/small_values.ttl') as f1:
+ # f1_lines = f1.readlines()
+ # with open('data/small_values_tmp.ttl') as f2:
+ # f2_lines = f2.readlines()
+ # self.assertEqual(f1_lines, f2_lines)
+ #
+ # self.assertEqual(os.stat("data/warning.log").st_size, 0)
+ # p = Path("data/warning.log")
+ # p.unlink()
+ # p = Path('data/small_values_tmp.ttl')
+ # p.unlink()
def test_triple_corrupted_edges(self):
corrupted_kgtk_file = Path('data/corrupted_kgtk.tsv')
