diff options
| author | 2020-06-01 23:11:38 -0400 | |
|---|---|---|
| committer | 2020-06-01 23:11:38 -0400 | |
| commit | e71c0d2e99f894c50b0d514729a8b44a90ce03a4 (patch) | |
| tree | fc2ab19492570cf481e6efca5c42736a3c85f875 /test/test_config.py | |
| parent | 40449733839d8ac9d6f44cc5942fb7623817d186 (diff) | |
| parent | a70a3246927b72f1ded37acd55ee719515441b5b (diff) | |
Update upstream source from tag 'upstream/1.14.0'
Update to upstream version '1.14.0'
with Debian dir e10ad4f35c0e6250ed14f70c95b81b307b7b2acf
Diffstat (limited to 'test/test_config.py')
| -rw-r--r-- | test/test_config.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/test_config.py b/test/test_config.py index cb202be..4171435 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -14,7 +14,8 @@ import unittest import json import tempfile -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +ROOTDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +sys.path.insert(0, ROOTDIR) from gallery_dl import config # noqa E402 @@ -156,10 +157,12 @@ class TestConfigFiles(unittest.TestCase): @staticmethod def _load(name): - rootdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - path = os.path.join(rootdir, "docs", name) - with open(path) as fp: - return json.load(fp) + path = os.path.join(ROOTDIR, "docs", name) + try: + with open(path) as fp: + return json.load(fp) + except FileNotFoundError: + raise unittest.SkipTest(path + " not available") if __name__ == '__main__': |
