Cleanup run-test build environment passing.

Use python variables rather than environment to pass state.

Cleanup the environment use left over from the bash version.

Test: build artifacts are same as before
Change-Id: I3ba7f9e31a9a7046c62d67c6c66af4988d5c469a
diff --git a/test/1966-get-set-local-objects-no-table/build.py b/test/1966-get-set-local-objects-no-table/build.py
index b7a608b..3a908c0 100644
--- a/test/1966-get-set-local-objects-no-table/build.py
+++ b/test/1966-get-set-local-objects-no-table/build.py
@@ -17,5 +17,5 @@
 
 
 def build(ctx):
-  ctx.bash("./generate-sources --" + os.environ["BUILD_MODE"])
+  ctx.bash("./generate-sources --" + ctx.mode)
   ctx.default_build()