[Scons-users] How to reset the global state?

Björn Pollex bjoern.pollex at googlemail.com
Thu Apr 24 08:19:11 EDT 2014


I am currently trying to write some unit-tests for a custom SCons tool. The
setup looks a bit like this:

from SCons.Environment import Environment

def test_something():
env = Environment(tools=['my_custom_tool'])
t, = env.MyCustomBuilder(args...)
assert 'something' in t.get_build_env()

def test_something_else():
env = Environment(tools=['my_custom_tool'])
t, = env.MyCustomBuilder(args...)
assert 'something_else' in t.get_build_env()

This is made up. The important part is, I try to build the same node
multiple times in different tests. When I run each of the tests alone, they
all pass. However, when I run the entire test module, SCons complains that
it has multiple ways to build the same target when it runs the second test
case.

So the question seems to be, how can I reset that global state of SCons
between test cases?

Regards,

Björn Pollex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140424/c2e26168/attachment.html


More information about the Scons-users mailing list