def testValidVariableNames(self): ns = Namespace() ns['value'] = 'this is fine' ns['flag:value'] = 'this is fine' ns[':declaring_flag'] = 'this is fine' with pytest.raises(InvalidNamespaceKeyName): ns.__setitem__('', 'this will not work') with pytest.raises(InvalidNamespaceKeyName): ns.__setitem__(':', 'this will not work') with pytest.raises(InvalidNamespaceKeyName): ns.__setitem__('flag:', 'this will not work')