Skip to content

Commit 0d04f54

Browse files
committed
Added test to check that 'from SCons.Variables import *' will import all types of SCons defined Variables
1 parent 666f119 commit 0d04f54

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

SCons/Variables/VariablesTests.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import SCons.Subst
3030
import SCons.Warnings
3131
from SCons.Util import cmp
32+
from SCons.Variables import *
3233

3334

3435
class Environment:
@@ -723,6 +724,27 @@ def test_AddOptionWithAliasUpdatesUnknown(self) -> None:
723724
assert len(r) == 0, r
724725
assert env['ADDEDLATER'] == 'added', env['ADDEDLATER']
725726

727+
def test_VariableTypesImportVisibility(self) -> None:
728+
"""Test that 'from SCons.Variables import *' will import all types of SCons defined Variables
729+
"""
730+
731+
try:
732+
x = BoolVariable('test', 'test option help', False)
733+
y = EnumVariable('test', 'test option help', 0,
734+
['one', 'two', 'three'],
735+
{})
736+
z = ListVariable('test', 'test option help', 'all',
737+
['one', 'two', 'three'])
738+
o = PackageVariable('test', 'test build variable help', '/default/path')
739+
p = PathVariable('test',
740+
'test build variable help',
741+
'/default/path')
742+
except Exception as e:
743+
self.fail(f"Could not import all known Variable types: {e}")
744+
745+
746+
747+
726748

727749
if __name__ == "__main__":
728750
unittest.main()

0 commit comments

Comments
 (0)