def test_in_memory_sample_fields(self):
        """Ensures that in-memory samples have their field values purged when
        a field is deleted.
        """
        dataset = fo.Dataset()

        s1 = fo.Sample("s1.png")
        s2 = fo.Sample("s2.png")

        dataset.add_samples([s1, s2])

        s1["new_field"] = 51
        dataset.delete_sample_field("new_field")
        s2["new_field"] = "fiftyone"

        self.assertIsNone(s1.new_field)
        self.assertEqual(s2.new_field, "fiftyone")
Ensures that in-memory samples have their field values purged when
        a field is deleted.
        
tests/unittests/sample_tests.py