diff options
| author | Adam Hupp <adam@hupp.org> | 2021-01-15 13:49:55 -0800 |
|---|---|---|
| committer | Adam Hupp <adam@hupp.org> | 2021-01-15 13:49:55 -0800 |
| commit | 2b8bb0d68eff1293050f10fec26cef38b4dfd282 (patch) | |
| tree | 54b4bb5d2691e533e72d77048ad653e90ecaac8b /test/libmagic_test.py | |
| parent | c6457815ee61581e9addf47fb75f9b550e06fcce (diff) | |
| download | python-magic-2b8bb0d68eff1293050f10fec26cef38b4dfd282.tar.gz | |
skip magic_descriptor tests in centos 7
Diffstat (limited to 'test/libmagic_test.py')
| -rw-r--r-- | test/libmagic_test.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/libmagic_test.py b/test/libmagic_test.py index e1623b4..64b7ec4 100644 --- a/test/libmagic_test.py +++ b/test/libmagic_test.py @@ -1,9 +1,11 @@ # coding: utf-8 import unittest - +import os import magic +# magic_descriptor is broken (?) in centos 7, so don't run those tests +SKIP_FROM_DESCRIPTOR = bool(os.environ.get('SKIP_FROM_DESCRIPTOR')) class MagicTestCase(unittest.TestCase): filename = 'testdata/test.pdf' @@ -21,6 +23,11 @@ class MagicTestCase(unittest.TestCase): self.assert_result(result) def test_detect_from_fobj(self): + + if SKIP_FROM_DESCRIPTOR: + self.skipTest("magic_descriptor is broken in this version of libmagic") + + with open(self.filename) as fobj: result = magic.detect_from_fobj(fobj) self.assert_result(result) |
