diff --git a/Makefile b/Makefile index 85c8e16f9..a5b3718cd 100644 --- a/Makefile +++ b/Makefile @@ -78,6 +78,7 @@ all: build/pyodide.asm.js \ build/matplotlib.html \ build/matplotlib-sideload.html \ build/renderedhtml.css \ + build/test.data \ build/numpy.data \ build/dateutil.data \ build/pytz.data \ @@ -183,6 +184,10 @@ build/kiwisolver.data: $(KIWISOLVER_LIBS) python2 $(FILEPACKAGER) build/kiwisolver.data --preload kiwisolver/build@/lib/python3.6/site-packages --js-output=build/kiwisolver.js --export-name=pyodide --exclude \*.wasm.pre --exclude __pycache__ +build/test.data: $(CPYTHONLIB) + python2 $(FILEPACKAGER) build/test.data --preload $(CPYTHONLIB)/test@/lib/python3.6/test --js-output=build/test.js --export-name=pyodide --exclude \*.wasm.pre --exclude __pycache__ + + root/.built: \ $(CPYTHONLIB) \ $(SIX_LIBS) \ @@ -208,6 +213,7 @@ root/.built: \ cd root/lib/python$(PYMINOR); \ rm -fr `cat ../../../remove_modules.txt`; \ rm encodings/mac_*.py; \ + rm -fr test; \ find . -name "*.wasm.pre" -type f -delete ; \ find -type d -name __pycache__ -prune -exec rm -rf {} \; \ ) diff --git a/src/pyodide.js b/src/pyodide.js index 13142791a..f716c4818 100644 --- a/src/pyodide.js +++ b/src/pyodide.js @@ -17,6 +17,7 @@ var languagePluginLoader = new Promise((resolve, reject) => { 'numpy' : [], 'pandas' : [ 'numpy', 'dateutil', 'pytz' ], 'pytz' : [], + 'test': [] }; let loadedPackages = new Set(); let loadPackage = (names) => { diff --git a/test/test_python.py b/test/test_python.py index 591086646..7dcbc1ef9 100644 --- a/test/test_python.py +++ b/test/test_python.py @@ -158,6 +158,7 @@ def test_open_url(selenium): def test_run_core_python_test(python_test, selenium): + selenium.load_package('test') try: selenium.run( "from test.libregrtest import main\n"