summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzyman <devnull@localhost>2010-02-06 00:50:11 +0000
committerfuzzyman <devnull@localhost>2010-02-06 00:50:11 +0000
commita1617f5fa507a25e3e306fbe6dd6e2c9ea03d362 (patch)
treec3abe9009f426acb25cbd3ffa05d9f558d55e514
parent464a45ff3aa83efb75619aafb060e08d7d1b241d (diff)
downloadconfigobj-a1617f5fa507a25e3e306fbe6dd6e2c9ea03d362.tar.gz
Fix bug in options deprecation warning added in 4.7.0
-rw-r--r--configobj.py4
-rw-r--r--docs/configobj.txt5
-rw-r--r--functionaltests/test_configobj.py12
3 files changed, 18 insertions, 3 deletions
diff --git a/configobj.py b/configobj.py
index e2e94a1..34260d2 100644
--- a/configobj.py
+++ b/configobj.py
@@ -83,7 +83,7 @@ tdquot = "'''%s'''"
# Sentinel for use in getattr calls to replace hasattr
MISSING = object()
-__version__ = '4.7.0'
+__version__ = '4.7.1'
try:
any
@@ -1201,7 +1201,7 @@ class ConfigObj(Section):
infile = infile or []
if options is not None:
import warnings
- warnings.warn('Passing in an options dictionary to ConfigObj() is ',
+ warnings.warn('Passing in an options dictionary to ConfigObj() is '
'deprecated. Use **options instead.',
DeprecationWarning, stacklevel=2)
diff --git a/docs/configobj.txt b/docs/configobj.txt
index 4b00897..2508e9b 100644
--- a/docs/configobj.txt
+++ b/docs/configobj.txt
@@ -2388,6 +2388,11 @@ CHANGELOG
This is an abbreviated changelog showing the major releases up to version 4.
From version 4 it lists all releases and changes.
+2010/02/06 - Version 4.7.1
+--------------------------
+
+* Fix bug in options deprecation warning added in 4.7.0
+
2010/01/09 - Version 4.7.0
--------------------------
diff --git a/functionaltests/test_configobj.py b/functionaltests/test_configobj.py
index b7e3ac2..59de524 100644
--- a/functionaltests/test_configobj.py
+++ b/functionaltests/test_configobj.py
@@ -2,6 +2,8 @@ import os
import unittest
from configobj import ConfigObj
+from warnings import catch_warnings
+
class TestConfigObj(unittest.TestCase):
def test_order_preserved(self):
@@ -26,4 +28,12 @@ class TestConfigObj(unittest.TestCase):
self.assertEqual(c2['section'].sections, ['section', 'section2', 'section3'])
self.assertFalse(c['section'] is c2['section'])
- self.assertFalse(c['section']['section'] is c2['section']['section']) \ No newline at end of file
+ self.assertFalse(c['section']['section'] is c2['section']['section'])
+
+ def test_options_deprecation(self):
+ with catch_warnings(record=True) as log:
+ ConfigObj(options={})
+
+ # unpack the only member of log
+ warning, = log
+ self.assertEqual(warning.category, DeprecationWarning) \ No newline at end of file