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
f38e01e4
Commit
f38e01e4
authored
Aug 03, 2018
by
Roman Yurchak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mechanism for testing imports
parent
1bdede95
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
packages/cycler/meta.yaml
packages/cycler/meta.yaml
+4
-0
test/test_common.py
test/test_common.py
+30
-0
No files found.
packages/cycler/meta.yaml
View file @
f38e01e4
...
@@ -5,3 +5,7 @@ package:
...
@@ -5,3 +5,7 @@ package:
source
:
source
:
url
:
https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz
url
:
https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz
md5
:
4cb42917ac5007d1cdff6cccfe2d016b
md5
:
4cb42917ac5007d1cdff6cccfe2d016b
test
:
imports
:
-
cycler
test/test_common.py
0 → 100644
View file @
f38e01e4
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
():
packages
=
[
name
for
name
in
os
.
listdir
(
PKG_DIR
)
if
(
PKG_DIR
/
name
).
is_dir
()]
return
packages
@
pytest
.
mark
.
parametrize
(
'name'
,
registered_packages
())
def
test_meta
(
selenium
,
name
):
# check that we can parse the meta.yaml
meta
=
common
.
parse_package
(
PKG_DIR
/
name
/
'meta.yaml'
)
if
'test'
in
meta
:
if
'imports'
in
meta
[
'test'
]:
# check imports
for
import_name
in
meta
[
'test'
][
'imports'
]:
selenium
.
load_package
(
import_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