diff --git a/pytest_mozwebqa/__init__.py b/pytest_mozwebqa/__init__.py index 729c55e..07ea6d5 100644 --- a/pytest_mozwebqa/__init__.py +++ b/pytest_mozwebqa/__init__.py @@ -1,3 +1,3 @@ -__version__ = '1.0' - from pytest_mozwebqa import * + +__version__ = pytest_mozwebqa.__version__ diff --git a/pytest_mozwebqa/html_report.py b/pytest_mozwebqa/html_report.py index 9ab8e3b..5650b2a 100644 --- a/pytest_mozwebqa/html_report.py +++ b/pytest_mozwebqa/html_report.py @@ -6,6 +6,7 @@ import base64 import cgi +import datetime import os import py import time @@ -194,6 +195,7 @@ def pytest_sessionfinish(self, session, exitstatus, __multicall__): self.config.option.environment or \ self.config.option.browser + generated = datetime.datetime.now() configuration = { 'Base URL': self.config.option.base_url, 'Build': self.config.option.build, @@ -208,6 +210,7 @@ def pytest_sessionfinish(self, session, exitstatus, __multicall__): 'Credentials': self.config.option.credentials_file, 'Sauce Labs Credentials': self.config.option.sauce_labs_credentials_file} + import pytest_mozwebqa doc = html.html( html.head( html.title('Test Report'), @@ -231,6 +234,10 @@ def pytest_sessionfinish(self, session, exitstatus, __multicall__): '.screenshot, .video {border: 1px solid #e6e6e6; float:right; height:240px; margin-left:5px; overflow:hidden; width:320px}\n', '.screenshot img {width: 320px}')), html.body( + html.p('Report generated on %s at %s by pytest-mozwebqa %s' % ( + generated.strftime('%d-%b-%Y'), + generated.strftime('%H:%M:%S'), + pytest_mozwebqa.__version__)), html.h2('Configuration'), html.table( [html.tr(html.td(k), html.td(v)) for k, v in sorted(configuration.items()) if v], diff --git a/pytest_mozwebqa/pytest_mozwebqa.py b/pytest_mozwebqa/pytest_mozwebqa.py index 01168b5..0e07ff5 100644 --- a/pytest_mozwebqa/pytest_mozwebqa.py +++ b/pytest_mozwebqa/pytest_mozwebqa.py @@ -12,6 +12,7 @@ import credentials +__version__ = '1.0' def pytest_configure(config): if not hasattr(config, 'slaveinput'):