Esempio n. 1
0
 def _check_and_assign(self, new_value):
     if new_value is None:
         self.clear()
     elif isinstance(new_value, str):
         self._assign_from_string(new_value)
     else:
         self._assign(new_value)
     if debugging.debug_mode():
         self._last_modified_stack = debugging.get_current_stack_trace()
Esempio n. 2
0
 def test_get_current_stack_trace(self):
     self.setup_debug_mode(debug_mode_enabled=True)
     stack_trace = debugging.get_current_stack_trace()
     self.assertStartsWith(sys.modules[__name__].__file__,
                           stack_trace[-1].filename)
     self.assertEqual(stack_trace[-1].function_name,
                      'test_get_current_stack_trace')
     self.assertEqual(stack_trace[-1].text,
                      'stack_trace = debugging.get_current_stack_trace()')
Esempio n. 3
0
 def _force_clear(self):
     self._before_clear()
     self._value = None
     if debugging.debug_mode():
         self._last_modified_stack = debugging.get_current_stack_trace()