Skip to content

Commit 8177ee5

Browse files
author
y-p
committed
TST: option names must valid, non-keyword python identifiers
1 parent 87126b9 commit 8177ee5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pandas/tests/test_config.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ def test_register_option(self):
4848
self.assertRaises(KeyError, self.cf.register_option, 'a.b.c.d2', 1,
4949
'doc')
5050

51+
# no python keywords
52+
self.assertRaises(ValueError, self.cf.register_option, 'print',0)
53+
# must be valid identifier (ensure attribute access works)
54+
self.assertRaises(ValueError, self.cf.register_option,
55+
'Oh my Goddess!',0)
56+
57+
5158
# we can register options several levels deep
5259
# without predefining the intermediate steps
5360
# and we can define differently named options
@@ -100,11 +107,6 @@ def test_case_insensitive(self):
100107
# testing warning with catch_warning was only added in 2.6
101108
self.assertTrue(self.cf._is_deprecated('kAnBaN'))
102109

103-
def test_set_option(self):
104-
self.cf.register_option('a', 1, 'doc')
105-
self.cf.register_option('b.c', 'hullo', 'doc2')
106-
self.cf.register_option('b.b', None, 'doc2')
107-
108110
def test_get_option(self):
109111
self.cf.register_option('a', 1, 'doc')
110112
self.cf.register_option('b.c', 'hullo', 'doc2')

0 commit comments

Comments
 (0)