summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTomaz Solc <tomaz.solc@tablix.org>2013-01-27 18:06:58 +0100
committerTomaz Solc <tomaz.solc@tablix.org>2013-01-27 18:11:18 +0100
commit9d93f0cae15fc73056d8d13f78d84dfbb4a2bf35 (patch)
tree5c927c466eff9f118df6cc62bd6ea511116e0094 /tests
parent832a044a0cbdf6d25338b427662a99df772299f2 (diff)
downloadunidecode-9d93f0cae15fc73056d8d13f78d84dfbb4a2bf35.tar.gz
Only count unicode-related warnings in test.
Diffstat (limited to 'tests')
-rw-r--r--tests/basic_2.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/basic_2.py b/tests/basic_2.py
index 3c27baa..cd0e9c7 100644
--- a/tests/basic_2.py
+++ b/tests/basic_2.py
@@ -22,7 +22,11 @@ class TestUnidecode(unittest.TestCase):
log = []
def showwarning_new(message, category, *args):
- log.append((message, category))
+ if ("not an unicode object" in str(message)) and \
+ (category is RuntimeWarning):
+ log.append((message, category))
+ else:
+ showwarning_old(message, category, *args)
showwarning_old = warnings.showwarning
warnings.showwarning = showwarning_new