Run unittests with Python 3 if it is available.
The check.sh script always runs the Python unittests with 'python', but if 'python3' is in the path, run it with that too. Fix a Python 3 compat issue and avoid passing None to max() and min(). Use an explicit intersect() function instead to intersect intervals.
This commit is contained in:
@@ -18,5 +18,14 @@ runif() {
|
||||
#
|
||||
# Install pylint with 'pip install pylint'.
|
||||
runif pylint --py3k --reports=no -- *.py cretonne isa
|
||||
|
||||
# Then run the unit tests again with Python 3.
|
||||
# We get deprecation warnings about assertRaisesRegexp which was renamed in
|
||||
# Python 3, but there doesn't seem to be an easy workaround.
|
||||
runif python3 -Wignore:Deprecation -m unittest discover
|
||||
|
||||
# Style linting.
|
||||
runif flake8 .
|
||||
|
||||
# Type checking.
|
||||
runif mypy --py2 build.py
|
||||
|
||||
Reference in New Issue
Block a user