summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-08-29 21:30:18 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2018-09-28 13:25:08 +0100
commitbade7d9f4a69e1ff0b904d8e0d63f0815a1a0c5b (patch)
treeb7d0d3d76928549e0cb6b7785fd5e915bdbfe261
parentf221f9835543493b4e49f5f80f6701a6ac9b21b0 (diff)
Empty directory error
-rw-r--r--framework/backends/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/framework/backends/__init__.py b/framework/backends/__init__.py
index 488ad5515..42b3c05db 100644
--- a/framework/backends/__init__.py
+++ b/framework/backends/__init__.py
@@ -155,7 +155,11 @@ def load(file_path):
tests = os.path.join(file_path, 'tests')
if os.path.exists(tests):
- return _extension(os.listdir(tests)[0])
+ files = os.listdir(tests)
+ if files:
+ return _extension(files[0])
+ else:
+ raise BackendError("No files found in {}".format(file_path))
else:
# At this point we have failed to find any sort of backend, just
# except and die