1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

Fix Python3 errors for device tests (#6670)

* Fix Python3 errors for device tests

The Python3 migration didn't include fixes for local scripts in the
device test tree.

Fatal build and run Python errors fixed.

The last update to xunitmerge is ~5 years ago, so it looks to be
unsupported now.

Use a local copy of the two components to allow patching to work with
Python3.

The serial test seems to send garbage chars (non-ASCII/etc.), so use a
codepage 437 which supports all 255 chars.

Fixes: #6660

* Run tests at 160MHz (req'd for some SSL connections)

* Fix debuglevel options for builder

* Fix Python3 interpreter path in xunitmerge

* Remove virtualenv on "make clean"

* Add appropriate attribution, license to xunitmerge

Add like to the original sources with the author's license to the
copied/fixed xunitmerge files.
This commit is contained in:
Earle F. Philhower, III
2019-10-26 13:58:54 -07:00
committed by GitHub
parent 1e17dddd89
commit 41ba21613d
8 changed files with 232 additions and 27 deletions

View File

@ -1,7 +1,7 @@
from mock_decorators import setup, teardown
from flask import Flask, request, redirect
from threading import Thread
import urllib2
import urllib
import os
import ssl
import time
@ -20,7 +20,7 @@ def setup_http_get(e):
return 'Server shutting down...'
@app.route("/", methods = ['GET', 'POST'])
def root():
print('Got data: ' + request.data);
print('Got data: ' + request.data.decode());
return 'hello!!!'
@app.route("/data")
def get_data():
@ -48,7 +48,7 @@ def setup_http_get(e):
@teardown('HTTP GET & POST requests')
def teardown_http_get(e):
response = urllib2.urlopen('http://localhost:8088/shutdown')
response = urllib.request.urlopen('http://localhost:8088/shutdown')
html = response.read()
time.sleep(1) # avoid address in use error on macOS
@ -86,6 +86,6 @@ def teardown_http_get(e):
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
p = os.path.dirname(os.path.abspath(__file__))
response = urllib2.urlopen('https://localhost:8088/shutdown', context=ctx)
response = urllib.request.urlopen('https://localhost:8088/shutdown', context=ctx)
html = response.read()