Python 2 does not support the concept of a non-local. Closures (accessing test from a parent function) only support read access, not assignment in Python 2.
The global keyword really does mean global, e.g. that the name lives in the module (global) namespace. The namespace of the function_one() function is not global, it is local (to that function).
In Python 3, you can mark a name as nonlocal, which would make your example work as expected. See PEP 3104 - Access to Names in Outer Scopes.
In Python 2, you'll have to resort to tricks instead. Make the name an attribute of the nested function, for example. 'reading' the function object as a closure is allowed, as is setting attributes on such closed-over objects:
def function_one():
def function_two():
function_two.test += 1
function_two.test = 1
function_two()
print test
Another trick is to use a mutable object, such as a list or a dictionary. Again, you are only reading the closed-over name, then altering the resulting object directly:
def function_one():
test = [1]
def function_two():
test[0] += 1
function_two()
print test[0]
globaldoes not mean the same thing asnonlocal(Python 3 only).globalreally means global, e.g. not in a function.testinfunction_twoexpects there to be a global nametest; the local nametestinfunction_one()is ignored.printas a statement.UnboundLocalError: local variable 'test' referenced before assignmentexception.