Skip to content

Commit

Permalink
fixing error with build.
Browse files Browse the repository at this point in the history
  • Loading branch information
toumorokoshi committed Jan 22, 2016
1 parent 868de4f commit a5ebc9f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions tests/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,15 @@ def test_not_able_to_serialize_subattribute(history):
history["unserializable"] = {"foo": re.compile("foo")}
with pytest.raises(HistoryException):
history.save()


def test_history_with_build(tmpdir, build):

@build.task
def main(build):
was_set = build.history.get("set", False)
build.history["set"] = True
return was_set

assert build.run_task("main") is False
assert build.run_task("main") is True
4 changes: 3 additions & 1 deletion uranium/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ def _finalize(self):
activate_content = ""
activate_content += self.envvars.generate_activate_content()
write_activate_this(self._root, additional_content=activate_content)
self.history[HISTORY_KEY]["python_version"] = "{0}.{1}".format(*sys.version_info[:2])
self.history[HISTORY_KEY] = {
"python_version": "{0}.{1}".format(*sys.version_info[:2])
}
self.history.save()


Expand Down

0 comments on commit a5ebc9f

Please sign in to comment.