diff --git a/FreeSimpleGUI/__init__.py b/FreeSimpleGUI/__init__.py index 5925f37c..1d4bbcf5 100644 --- a/FreeSimpleGUI/__init__.py +++ b/FreeSimpleGUI/__init__.py @@ -15523,7 +15523,8 @@ def main_global_pysimplegui_settings(): pysimplegui_user_settings.set(json.dumps(('-ttk scroll-', key[1])), value) # Upgrade Service Settings - pysimplegui_user_settings.set('-upgrade show only critical-', values['-UPGRADE SHOW ONLY CRITICAL-']) + if '-UPGRADE SHOW ONLY CRITICAL-' in values: + pysimplegui_user_settings.set('-upgrade show only critical-', values['-UPGRADE SHOW ONLY CRITICAL-']) theme(new_theme) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_settings.py b/tests/test_settings.py new file mode 100644 index 00000000..eb830de0 --- /dev/null +++ b/tests/test_settings.py @@ -0,0 +1,14 @@ +import unittest + +import FreeSimpleGUI as sg + + +class MyTestCase(unittest.TestCase): + def test_open_and_close_global_psg_settings(self): + sg.popup_ok("In the settings window (next window) press OK button to continue the test.") + ok_pressed = sg.main_global_pysimplegui_settings() + self.assertEqual(ok_pressed, True) + + +if __name__ == '__main__': + unittest.main()