Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
b47713d4
Commit
b47713d4
authored
Aug 20, 2018
by
Michael Droettboom
Committed by
GitHub
Aug 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #98 from rth/common-tests
Mechanism for testing imports
parents
367fc17c
af8058c4
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
80 additions
and
0 deletions
+80
-0
packages/cycler/meta.yaml
packages/cycler/meta.yaml
+4
-0
packages/kiwisolver/meta.yaml
packages/kiwisolver/meta.yaml
+4
-0
packages/matplotlib/meta.yaml
packages/matplotlib/meta.yaml
+4
-0
packages/numpy/meta.yaml
packages/numpy/meta.yaml
+5
-0
packages/pandas/meta.yaml
packages/pandas/meta.yaml
+4
-0
packages/pyparsing/meta.yaml
packages/pyparsing/meta.yaml
+4
-0
packages/python-dateutil/meta.yaml
packages/python-dateutil/meta.yaml
+4
-0
packages/pytz/meta.yaml
packages/pytz/meta.yaml
+4
-0
test/test_common.py
test/test_common.py
+47
-0
No files found.
packages/cycler/meta.yaml
View file @
b47713d4
...
...
@@ -5,3 +5,7 @@ package:
source
:
url
:
https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz
md5
:
4cb42917ac5007d1cdff6cccfe2d016b
test
:
imports
:
-
cycler
packages/kiwisolver/meta.yaml
View file @
b47713d4
...
...
@@ -5,3 +5,7 @@ package:
source
:
url
:
https://files.pythonhosted.org/packages/31/60/494fcce70d60a598c32ee00e71542e52e27c978e5f8219fae0d4ac6e2864/kiwisolver-1.0.1.tar.gz
md5
:
e2a1718b837e2cd001f7c06934616fcd
test
:
imports
:
-
kiwisolver
packages/matplotlib/meta.yaml
View file @
b47713d4
...
...
@@ -39,3 +39,7 @@ requirements:
-
pyparsing
-
python-dateutil
-
pytz
test
:
imports
:
-
matplotlib
packages/numpy/meta.yaml
View file @
b47713d4
...
...
@@ -20,3 +20,8 @@ source:
build
:
cflags
:
-include math.h -I../../config
test
:
imports
:
-
numpy
packages/pandas/meta.yaml
View file @
b47713d4
...
...
@@ -17,3 +17,7 @@ requirements:
-
numpy
-
python-dateutil
-
pytz
test
:
imports
:
-
pandas
packages/pyparsing/meta.yaml
View file @
b47713d4
...
...
@@ -8,3 +8,7 @@ source:
patches
:
-
patches/dummy_threading.patch
test
:
imports
:
-
pyparsing
packages/python-dateutil/meta.yaml
View file @
b47713d4
...
...
@@ -8,3 +8,7 @@ source:
patches
:
-
patches/dummy-thread-lock.patch
test
:
imports
:
-
dateutil
packages/pytz/meta.yaml
View file @
b47713d4
...
...
@@ -8,3 +8,7 @@ source:
patches
:
-
patches/dummy-threading.patch
test
:
imports
:
-
pytz
test/test_common.py
0 → 100644
View file @
b47713d4
import
pytest
import
os
from
pathlib
import
Path
import
sys
BASE_DIR
=
Path
(
__file__
).
parent
.
parent
PKG_DIR
=
BASE_DIR
/
'packages'
# TODO: remove once we have a proper Python package for common functions
sys
.
path
.
append
(
str
(
BASE_DIR
/
'tools'
))
import
common
# noqa
def
registered_packages
():
"""Returns a list of registred package names"""
packages
=
[
name
for
name
in
os
.
listdir
(
PKG_DIR
)
if
(
PKG_DIR
/
name
).
is_dir
()]
return
packages
def
registered_packages_meta
():
"""Returns a dictionary with the contents of `meta.yaml`
for each registed package
"""
packages
=
registered_packages
return
{
name
:
common
.
parse_package
(
PKG_DIR
/
name
/
'meta.yaml'
)
for
name
in
packages
}
UNSUPPORTED_PACKAGES
=
{
'ChromeWrapper'
:
[
'pandas'
],
'FirefoxWrapper'
:
[]}
@
pytest
.
mark
.
parametrize
(
'name'
,
registered_packages
())
def
test_import
(
name
,
selenium
):
# check that we can parse the meta.yaml
meta
=
common
.
parse_package
(
PKG_DIR
/
name
/
'meta.yaml'
)
if
name
in
UNSUPPORTED_PACKAGES
[
selenium
.
__class__
.
__name__
]:
pytest
.
xfail
(
'{} fails to load and is not supported on {}.'
.
format
(
name
,
selenium
.
__class__
.
__name__
.
replace
(
'Wrapper'
,
''
)))
for
import_name
in
meta
.
get
(
'test'
,
{}).
get
(
'imports'
,
[]):
selenium
.
load_package
(
name
)
selenium
.
run
(
'import %s'
%
import_name
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment