In Python 3.8 and higher there is a feature for cases like this - assignment expression.
test = {
'x' : (x_val := 1), # this can be something complex,
# like function call or whatever
'y' : x_val + 1,
}
So basically, you assign value of 'x' to some variable and then just use it.