URL: https://github.com/freeipa/freeipa/pull/441
Author: tiran
 Title: #441: Print test env information
Action: opened

PR body:
"""
Print api.env, uname, euid/egid, cwd and Python version when tests are
run with -v (e.g. ipa-run-tests -v).

Signed-off-by: Christian Heimes <chei...@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/441/head:pr441
git checkout pr441
From 96636f6c81e68785c2a2a2f39fca1706e686e6ae Mon Sep 17 00:00:00 2001
From: Christian Heimes <chei...@redhat.com>
Date: Wed, 8 Feb 2017 12:29:33 +0100
Subject: [PATCH] Print test env information

Print api.env, uname, euid/egid, cwd and Python version when tests are
run with -v (e.g. ipa-run-tests -v).

Signed-off-by: Christian Heimes <chei...@redhat.com>
---
 ipatests/conftest.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/ipatests/conftest.py b/ipatests/conftest.py
index 6d8ba60..511d7b7 100644
--- a/ipatests/conftest.py
+++ b/ipatests/conftest.py
@@ -3,6 +3,10 @@
 #
 from __future__ import print_function
 
+import os
+import pprint
+import sys
+
 from ipalib import api
 from ipalib.cli import cli_plugins
 try:
@@ -78,3 +82,10 @@ def pytest_cmdline_main(config):
     for klass in cli_plugins:
         api.add_plugin(klass)
     api.finalize()
+    if config.option.verbose:
+        print('api.env: ')
+        pprint.pprint({k: api.env[k] for k in api.env})
+        print("uname: {}".format(os.uname()))
+        print("euid: {}, egid: {}".format(os.geteuid(), os.getegid()))
+        print("working dir: {}".format(os.path.abspath(os.getcwd())))
+        print('sys.version: {}'.format(sys.version))
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to