Skip to content

Commit

Permalink
fix(el7): fix for rhel7
Browse files Browse the repository at this point in the history
  • Loading branch information
definite committed Jul 19, 2018
1 parent 2fc3033 commit 2b0b296
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
3 changes: 1 addition & 2 deletions ZanataArgParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"""ZanataArgParser is an sub-class of ArgumentParser
that handles sub-parser, environments more easily."""

from __future__ import (
absolute_import, division, print_function)
from __future__ import (absolute_import, division, print_function)

from argparse import ArgumentParser, ArgumentError
import logging
Expand Down
3 changes: 1 addition & 2 deletions ZanataFunctions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env python
"""Generic Helper Function"""

from __future__ import (
absolute_import, division, print_function, unicode_literals)
from __future__ import (absolute_import, division, print_function)

import codecs
import errno
Expand Down
14 changes: 12 additions & 2 deletions py-test-all
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,27 @@

set -eu
PY_SOURCES=*.py
if which pytest-2 &>/dev/null; then
PYTEST=pytest-2
elif which py.test-2.7 &>/dev/null; then
PYTEST=py.test-2.7
else
echo "pytest-2 is not installed" > /dev/stderr
exit 1
fi

## pytest
echo "====== pytest-2 ======" > /dev/stderr
pytest-2 *.py
$PYTEST *.py

## Pylint
echo "====== pylint ======" > /dev/stderr
python2 -m pylint $PY_SOURCES

## flake8
echo "====== flake8 =====" > /dev/stderr
flake8 --benchmark $PY_SOURCES
## E126(continuation line over-indented for hanging indent) seems to
## clash with pylint indent rules
flake8 --ignore E126 --benchmark $PY_SOURCES


4 changes: 1 addition & 3 deletions testZanataArgParser.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env python
"""Test the ZanataArgParser.py"""

from __future__ import (
absolute_import, division, print_function)
from __future__ import (absolute_import, division, print_function)

import StringIO # pylint: disable=E0401
import os
Expand Down Expand Up @@ -42,7 +41,6 @@ def _match_result(
captured_output = StringIO.StringIO()
sys.stdout = captured_output
args = getattr(self.parser, method)(param_list)
sys.stdout = sys.__stdout__
if stdout_pattern:
self.assertRegexpMatches( # pylint: disable=W1505
captured_output.getvalue(), stdout_pattern)
Expand Down
3 changes: 1 addition & 2 deletions testZanataFunctions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env python
"""Test the ZanataFunctions"""

from __future__ import (
absolute_import, division, print_function, unicode_literals)
from __future__ import (absolute_import, division, print_function)

import subprocess # nosec
import unittest
Expand Down

0 comments on commit 2b0b296

Please sign in to comment.