aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build_history/blacklist.txt2
-rw-r--r--sources/pyside2/tests/QtCore/bug_829.py25
2 files changed, 20 insertions, 7 deletions
diff --git a/build_history/blacklist.txt b/build_history/blacklist.txt
index 97e2a046..9c9dabf7 100644
--- a/build_history/blacklist.txt
+++ b/build_history/blacklist.txt
@@ -10,8 +10,6 @@
linux
darwin
win32
-[QtCore::bug_829]
- win32
[QtCore::qfile_test]
win32
darwin py3
diff --git a/sources/pyside2/tests/QtCore/bug_829.py b/sources/pyside2/tests/QtCore/bug_829.py
index 5b14f7b5..730a2e9e 100644
--- a/sources/pyside2/tests/QtCore/bug_829.py
+++ b/sources/pyside2/tests/QtCore/bug_829.py
@@ -30,21 +30,36 @@
# Test case for PySide bug 829
import unittest
-from PySide2.QtCore import QSettings
-import tempfile
+from PySide2.QtCore import QDir, QSettings, QTemporaryFile
+import os
class QVariantConversions(unittest.TestCase):
+
+ _confFileName = None
+
def testDictionary(self):
- confFile = tempfile.NamedTemporaryFile(delete=False)
- s = QSettings(confFile.name, QSettings.IniFormat)
+ confFile = QTemporaryFile(QDir.tempPath() + '/pysidebug829_XXXXXX.ini')
+ confFile.setAutoRemove(False)
+ self.assertTrue(confFile.open())
+ confFile.close()
+ self._confFileName = confFile.fileName()
+ del confFile
+ s = QSettings(self._confFileName, QSettings.IniFormat)
+ self.assertEqual(s.status(), QSettings.NoError)
# Save value
s.setValue('x', {1: 'a'})
s.sync()
+ self.assertEqual(s.status(), QSettings.NoError)
del s
# Restore value
- s = QSettings(confFile.name, QSettings.IniFormat)
+ s = QSettings(self._confFileName, QSettings.IniFormat)
+ self.assertEqual(s.status(), QSettings.NoError)
self.assertEqual(s.value('x'), {1: 'a'})
+ def __del__(self):
+ if self._confFileName is not None:
+ os.unlink(QDir.toNativeSeparators(self._confFileName))
+
if __name__ == '__main__':
unittest.main()