Minimal test for plugins checking pkg_resources

This commit is contained in:
Dmitri Bogomolov 2021-02-20 22:48:55 +02:00
parent 3291e97459
commit d640f3bc25
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

16
src/plugins/tests.py Normal file
View File

@ -0,0 +1,16 @@
import unittest
from importlib import import_module
try:
import pkg_resources
except ImportError:
pkg_resources = None
class TestPlugins(unittest.TestCase):
"""Test case for plugins package"""
def test_get_plugin(self):
"""Import from plugin raises ImportError without pkg_resources"""
if pkg_resources is None:
with self.assertRaises(ImportError):
import_module('plugin')