diff options
author | Simon Feltman <sfeltman@src.gnome.org> | 2014-04-28 15:23:30 -0700 |
---|---|---|
committer | Thomas A Caswell <tcaswell@gmail.com> | 2015-09-29 15:01:48 -0400 |
commit | 8d6456344b80fa5f8f745fc92e364ee8b6a75cbf (patch) | |
tree | 7bd2f38555b01d3f11f031595618c6c739bb3f9a /tests | |
parent | 2cfccfb860bbc8c5be77792012172bceb7e8b9e2 (diff) | |
download | gobject-introspection-8d6456344b80fa5f8f745fc92e364ee8b6a75cbf.tar.gz |
giscanner: Enable "true division" for all Python files
Import Python 3 compatible "true division" from the future (PEP 238).
This changes the Python 2 classic division which uses floor division
on integers to true division. Verfied we don't actually use the
division operator anywhere in the code base so this a safety for
supporting both Python 2 and 3.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scanner/annotationparser/test_parser.py | 1 | ||||
-rw-r--r-- | tests/scanner/annotationparser/test_patterns.py | 1 | ||||
-rw-r--r-- | tests/scanner/test_sourcescanner.py | 1 | ||||
-rw-r--r-- | tests/scanner/test_transformer.py | 1 | ||||
-rw-r--r-- | tests/warn/warningtester.py | 1 |
5 files changed, 5 insertions, 0 deletions
diff --git a/tests/scanner/annotationparser/test_parser.py b/tests/scanner/annotationparser/test_parser.py index 01bd000e..17eb12b3 100644 --- a/tests/scanner/annotationparser/test_parser.py +++ b/tests/scanner/annotationparser/test_parser.py @@ -26,6 +26,7 @@ Tests ensuring annotationparser.py continues to function correctly. ''' from __future__ import absolute_import +from __future__ import division import difflib import os diff --git a/tests/scanner/annotationparser/test_patterns.py b/tests/scanner/annotationparser/test_patterns.py index 327f240d..1648a08b 100644 --- a/tests/scanner/annotationparser/test_patterns.py +++ b/tests/scanner/annotationparser/test_patterns.py @@ -30,6 +30,7 @@ against the expected output. ''' from __future__ import absolute_import +from __future__ import division from giscanner.annotationparser import (COMMENT_BLOCK_START_RE, COMMENT_BLOCK_END_RE, COMMENT_ASTERISK_RE, INDENTATION_RE, EMPTY_LINE_RE, diff --git a/tests/scanner/test_sourcescanner.py b/tests/scanner/test_sourcescanner.py index a6655540..0f1e4837 100644 --- a/tests/scanner/test_sourcescanner.py +++ b/tests/scanner/test_sourcescanner.py @@ -1,4 +1,5 @@ from __future__ import absolute_import +from __future__ import division import unittest import tempfile diff --git a/tests/scanner/test_transformer.py b/tests/scanner/test_transformer.py index c9ca75f3..cf315809 100644 --- a/tests/scanner/test_transformer.py +++ b/tests/scanner/test_transformer.py @@ -1,4 +1,5 @@ from __future__ import absolute_import +from __future__ import division import unittest import tempfile diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py index 4138518a..600260d2 100644 --- a/tests/warn/warningtester.py +++ b/tests/warn/warningtester.py @@ -1,4 +1,5 @@ from __future__ import absolute_import +from __future__ import division import __builtin__ import os |