Skip to content
Myr

Merge pull request #2558 from pallets/appveyor

Before adoption: this commit came in with the history the project adopted, so no landing records it.

add appveyor configuration

authored by David Lord · committed by GitHub · parents 40745bb, 333865e · Browse files · 3 files+41 added−18 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+41 added−18 removed

  • tests:+8 added−16 removed
  • other:+33 added−2 removed

3 files+41 added−18 removed

modified:examples/flaskr/tests/test_flaskr.py+8 added-16 removed
15 unmodified lines
16from flaskr.blueprints.flaskr import init_db171819@pytest.fixture20def app(request):2122 db_fd, temp_db_location = tempfile.mkstemp()20def app():21 db_fd, db_path = tempfile.mkstemp()22 config = {24 'DATABASE': temp_db_location,23 'DATABASE': db_path,24 'TESTING': True,26 'DB_FD': db_fd25 }2826 app = create_app(config=config)2728 with app.app_context():29 init_db()30 yield app3132 os.close(db_fd)33 os.unlink(db_path)343536@pytest.fixture37def client(request, app):37def client(app):38 return app.test_client()3939 client = app.test_client()4041 def teardown():42 os.close(app.config['DB_FD'])43 os.unlink(app.config['DATABASE'])44 request.addfinalizer(teardown)4546 return client474841def login(client, username, password):42 return client.post('/login', data=dict(43 username=username,44 password=password
39 unmodified lines
modified:flask/helpers.py+10 added-2 removed
40 unmodified lines
4142from .signals import message_flashed43from .globals import session, _request_ctx_stack, _app_ctx_stack, \44 current_app, request45from ._compat import string_types, text_type45from ._compat import string_types, text_type, PY2464747# sentinel48_missing = object()4950
949 unmodified lines
10001001def is_ip(value):1002 """Determine if the given string is an IP address.10031004 Python 2 on Windows doesn't provide ``inet_pton``, so this only1005 checks IPv4 addresses in that environment.10061007 :param value: value to check1008 :type value: str10091010 :return: True if string is an IP address1011 :rtype: bool1012 """1013 if PY2 and os.name == 'nt':1014 try:1015 socket.inet_aton(value)1016 return True1017 except socket.error:1018 return False10191020 for family in (socket.AF_INET, socket.AF_INET6):1021 try:1022 socket.inet_pton(family, value)
6 unmodified lines
added:.appveyor.yml+23 added