Merge pull request #223 from rth/pure-python-tests

TST Add ability to run pure python tests
This commit is contained in:
Michael Droettboom 2018-10-15 16:31:28 -04:00 committed by GitHub
commit 4879b77e52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 0 deletions

View File

@ -69,6 +69,15 @@ jobs:
command: |
pytest test -v -k chrome
test-python:
<<: *defaults
steps:
- checkout
- run:
name: test
command: |
pytest test -v -k 'not (chrome or firefox)'
benchmark:
<<: *defaults
steps:
@ -106,6 +115,7 @@ workflows:
- test-firefox:
requires:
- build
- test-python
- benchmark:
requires:
- build
@ -113,6 +123,7 @@ workflows:
requires:
- test-chrome
- test-firefox
- test-python
filters:
branches:
only: master

18
test/src/test_pyodide.py Normal file
View File

@ -0,0 +1,18 @@
import sys
from pathlib import Path
from textwrap import dedent
sys.path.append(str(Path(__file__).parents[2] / 'src'))
from pyodide import find_imports # noqa: E402
def test_find_imports():
res = find_imports(dedent("""
import six
import numpy as np
from scipy import sparse
import matplotlib.pyplot as plt
"""))
assert set(res) == {'numpy', 'scipy', 'six', 'matplotlib'}