def test_setting_enabled_property(self):
        """Test if spinner stops writing when enabled property set to False
        """
        spinner = Halo(text='foo', stream=self._stream)
        spinner.start()
        time.sleep(0.5)

        spinner.enabled = False
        bytes_written = self._stream.tell()
        time.sleep(0.5)
        spinner.stop()

        total_bytes_written = self._stream.tell()
        self.assertEqual(total_bytes_written, bytes_written)
Test if spinner stops writing when enabled property set to False
        
tests/test_halo.py