Status: Accepted
Owner: ----
Labels: Type-Enhancement Priority-Medium Target-2.6.2

New issue 940 by pekka.klarck: `Import Variables` keyword should import variable files even if they are already imported
http://code.google.com/p/robotframework/issues/detail?id=940

Let's assume we have two variable files VF1.py and VF2.py with content 'VAR=1' and 'VAR=2', respectively. If these variables files are imported using Import Variables keyword like below, variable `${VAR}` will, surprisingly, have value 2.

    Import Variables   path/to/VF1.py
    Import Variables   path/to/VF2.py
    Import Variables   path/to/VF1.py

The reason this happens is that variables files (and resource and libraries) are imported only once per suite. Possible future imports are silently ignored. The idea has been to avoid unnecessary duplicate imports, and possible side effects in imports, but at least in the above case the logic fails badly.

We need to think about this logic in general, but at least with Import Variables keyword the variable file should always be imported.

Reply via email to