summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2014-10-27 13:06:29 +0100
committerholger krekel <holger@merlinux.eu>2014-10-27 13:06:29 +0100
commit9bfeba98f75849347f8622bbff048f71d15d60f4 (patch)
treefd325aa2a9bcaea2901f46996dabc26a4ce55b61
parentf0bd9a331fc126af4a4c102831e6ef8fdd14b89a (diff)
downloadtox-9bfeba98f75849347f8622bbff048f71d15d60f4.tar.gz
fix issue199 -- fill result log structure ahead of creating virtualenv
-rw-r--r--CHANGELOG6
-rw-r--r--setup.py2
-rw-r--r--tests/test_result.py12
-rw-r--r--tox/__init__.py2
-rw-r--r--tox/result.py11
5 files changed, 23 insertions, 10 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 37f963a..cfb5891 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+1.8.2.dev
+-----------
+
+- fix issue199: fill resultlog structure ahead of virtualenv creation
+
1.8.1
-----------
@@ -11,7 +16,6 @@
- report subprocess exit code when execution fails. Thanks Marius
Gedminas.
-
1.8.0
-----------
diff --git a/setup.py b/setup.py
index c8424cf..46730a0 100644
--- a/setup.py
+++ b/setup.py
@@ -26,7 +26,7 @@ def main():
description='virtualenv-based automation of test activities',
long_description=open("README.rst").read(),
url='http://tox.testrun.org/',
- version='1.8.1',
+ version='1.8.2.dev1',
license='http://opensource.org/licenses/MIT',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
author='holger krekel',
diff --git a/tests/test_result.py b/tests/test_result.py
index 6df834a..206a99c 100644
--- a/tests/test_result.py
+++ b/tests/test_result.py
@@ -10,6 +10,18 @@ def pkg(tmpdir):
p.write("whatever")
return p
+def test_pre_set_header(pkg):
+ replog = ResultLog()
+ d = replog.dict
+ assert replog.dict == d
+ assert replog.dict["reportversion"] == "1"
+ assert replog.dict["toxversion"] == tox.__version__
+ assert replog.dict["platform"] == sys.platform
+ assert replog.dict["host"] == py.std.socket.getfqdn()
+ data = replog.dumps_json()
+ replog2 = ResultLog.loads_json(data)
+ assert replog2.dict == replog.dict
+
def test_set_header(pkg):
replog = ResultLog()
d = replog.dict
diff --git a/tox/__init__.py b/tox/__init__.py
index 5c38ad7..6797068 100644
--- a/tox/__init__.py
+++ b/tox/__init__.py
@@ -1,5 +1,5 @@
#
-__version__ = '1.8.1'
+__version__ = '1.8.2.dev1'
class exception:
class Error(Exception):
diff --git a/tox/result.py b/tox/result.py
index 694138c..9954044 100644
--- a/tox/result.py
+++ b/tox/result.py
@@ -1,9 +1,7 @@
import sys
import py
-try:
- import json
-except ImportError:
- import simplejson as json
+from tox import __version__ as toxver
+import json
class ResultLog:
@@ -11,12 +9,11 @@ class ResultLog:
if dict is None:
dict = {}
self.dict = dict
-
- def set_header(self, installpkg):
- from tox import __version__ as toxver
self.dict.update({"reportversion": "1", "toxversion": toxver})
self.dict["platform"] = sys.platform
self.dict["host"] = py.std.socket.getfqdn()
+
+ def set_header(self, installpkg):
self.dict["installpkg"] = dict(
md5=installpkg.computehash("md5"),
sha256=installpkg.computehash("sha256"),