I am trying to delete a variable from QGIS Project variables. I didn't find the functionality in
QgsExpressionContextUtils (I use it to set a variable).
I also tried to do this:
project_context_scope = QgsExpressionContextUtils.projectScope() project_context_scope.removeVariable('test')
It does remove from project_context_scope. But, when I open the QGIS Project properties to see the list of variables, the deleted variable is still exist.
May be I was wrong in getting the instance of
project_context_scope, since it's not a singleton and
projectScope create new object.