Commit f38e01e4 authored by Roman Yurchak's avatar Roman Yurchak

Mechanism for testing imports

parent 1bdede95
...@@ -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
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)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment