-
Notifications
You must be signed in to change notification settings - Fork 19
/
test_package.py
51 lines (46 loc) · 710 Bytes
/
test_package.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import pytest
import sys
packages = list(filter(None, """
_multithreading_init
aliasing
bunch
caching
collections
colors
concurrency
contexts
decorations
deprecation
exceptions
fixtures
gevent
humanize
interaction
lockstep
meta
misc
predicates
properties
random
resilience
signals
sync
tables
threadtree
timing
tokens
typed_struct
units
words
ziplog
""".split()))
@pytest.yield_fixture
def clean_modules():
yield
roots = "easypy", "logbook", "logging"
for n in sorted(sys.modules):
if any(n.startswith(root) for root in roots):
sys.modules.pop(n)
@pytest.mark.parametrize("package", packages)
def test_package(package, clean_modules):
__import__("easypy.%s" % package)