def setUp(self):
if self._should_be_skipped_due_to_version():
pytest.skip('Test cannot run with Python %s.' % (sys.version.split(' ')[0],))
missing = []
for req in self._test_file.options['requires']:
try:
__import__(req)
except ImportError:
missing.append(req)
if missing:
pytest.skip('Requires %s to be present.' % (','.join(missing),))
if self._test_file.options['except_implementations']:
implementations = [
item.strip() for item in
self._test_file.options['except_implementations'].split(",")
]
implementation = platform.python_implementation()
if implementation in implementations:
pytest.skip(
'Test cannot run with Python implementation %r'
% (implementation, ))
评论列表
文章目录