Skip to content

Commit

Permalink
Updated examples to work with pypy which has a incomplete sqlite3 in …
Browse files Browse the repository at this point in the history
…1.4. Also disable a euc-kr test that does not work on pypy
  • Loading branch information
mitsuhiko committed Dec 1, 2010
1 parent 8569dfe commit 1640679
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/flaskr/flaskr.py
Expand Up @@ -10,7 +10,7 @@
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sqlite3
from sqlite3 import dbapi2 as sqlite3

This comment has been minimized.

Copy link
@root-11

root-11 Jul 1, 2014

Contributor

This is inconsistent with the tutorial. Please cross check

from contextlib import closing
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
Expand Down
2 changes: 1 addition & 1 deletion examples/minitwit/minitwit.py
Expand Up @@ -10,7 +10,7 @@
"""
from __future__ import with_statement
import time
import sqlite3
from sqlite3 import dbapi2 as sqlite3
from hashlib import md5
from datetime import datetime
from contextlib import closing
Expand Down
12 changes: 12 additions & 0 deletions tests/flask_tests.py
Expand Up @@ -29,6 +29,15 @@
sys.path.append(os.path.join(example_path, 'minitwit'))


def has_encoding(name):
try:
import codecs
codecs.lookup(name)
return True
except LookupError:
return False


# config keys used for the ConfigTestCase
TEST_KEY = 'foo'
SECRET_KEY = 'devkey'
Expand Down Expand Up @@ -698,6 +707,9 @@ def index():
assert rv.status_code == 200
assert rv.data == u'정상처리'.encode('utf-8')

if not has_encoding('euc-kr'):
test_modified_url_encoding = None


class TemplatingTestCase(unittest.TestCase):

Expand Down

0 comments on commit 1640679

Please sign in to comment.