mirror of https://github.com/MISP/PyMISP
fix: Make reportlab tests optional if missing dep.
parent
49ef62d930
commit
a2d7cbd763
|
@ -6,26 +6,23 @@ import sys
|
|||
import time
|
||||
import unittest
|
||||
|
||||
from pymisp import MISPEvent
|
||||
|
||||
manual_testing = False
|
||||
|
||||
import logging
|
||||
logging.disable(logging.CRITICAL)
|
||||
manual_testing = False
|
||||
|
||||
try:
|
||||
from pymisp import MISPEvent
|
||||
from pymisp.tools import reportlab_generator
|
||||
reportlab_missing = False
|
||||
except Exception:
|
||||
if sys.version_info < (3, 6):
|
||||
print('This test suite requires Python 3.6+, breaking.')
|
||||
sys.exit(0)
|
||||
else:
|
||||
raise
|
||||
reportlab_missing = True
|
||||
|
||||
|
||||
class TestPDFExport(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
if reportlab_missing:
|
||||
self.skipTest('reportlab missing, skip test.')
|
||||
self.maxDiff = None
|
||||
self.mispevent = MISPEvent()
|
||||
if not manual_testing:
|
||||
|
|
Loading…
Reference in New Issue