Skip to content

Commit

Permalink
temp test
Browse files Browse the repository at this point in the history
  • Loading branch information
KSchopmeyer committed Jul 15, 2017
1 parent 26267eb commit 83e582c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions testsuite/test_wbemcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,18 @@ def test(self): # pylint: disable=missing-docstring
# Disable python warnings for wbemcli call
# because some imports generate deprecated warnings
# that appear in std_err when nothing expected
if os.name == 'nt':
pywarn = 'set PYTHONWARNINGS= &'
else:
pywarn = 'unset PYTHONWARNINGS &&'
# if os.name == 'nt':
# pywarn = 'set PYTHONWARNINGS= &'
# else:
# pywarn = 'unset PYTHONWARNINGS &&'

command = '%s %s' % (pywarn, command)
command = 'export PYTHONWARNINGS="" && %s' % command
proc = Popen(command, shell=True, stdout=PIPE, stderr=PIPE)
std_out, std_err = proc.communicate()
# print('std_out:\n%s\nstd_err:\n%s' % (std_out, std_err))
exitcode = proc.returncode
print('exitcode %s std_out:\n%s\nstd_err:\n%s' % (exitcode,
std_out,
std_err))
if six.PY3:
std_out = std_out.decode()
std_err = std_err.decode()
Expand All @@ -141,7 +143,9 @@ def test(self): # pylint: disable=missing-docstring
command,
exitcode, std_err)))

if not test_params.expected_stderr:
if test_params.expected_stderr is None:
print('searchresult %s' % re.search('ImportWarning',
std_err))
if re.search('ImportWarning', std_err) is None:
self.assertEqual(std_err, "",
'Test %s stderr not empty as '
Expand Down

0 comments on commit 83e582c

Please sign in to comment.