forked from celery/celery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_CI_reqs.py
35 lines (27 loc) · 873 Bytes
/
test_CI_reqs.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
import os
import pprint
import pytest
def _get_extras_reqs_from(name):
try:
with open(os.path.join('requirements', name)) as fh:
lines = fh.readlines()
except OSError:
pytest.skip('requirements dir missing, not running from dist?')
else:
return {
line.split()[1] for line in lines
if line.startswith('-r extras/')
}
def _get_all_extras():
return {
os.path.join('extras', f)
for f in os.listdir('requirements/extras/')
}
def test_all_reqs_enabled_in_tests():
ci_default = _get_extras_reqs_from('test-ci-default.txt')
ci_base = _get_extras_reqs_from('test-ci-base.txt')
defined = ci_default | ci_base
all_extras = _get_all_extras()
diff = all_extras - defined
print('Missing CI reqs:\n{}'.format(pprint.pformat(diff)))
assert not diff