From 0dcf467919390822563f263e18780dbfa19c1b80 Mon Sep 17 00:00:00 2001 From: Matt Griswold Date: Wed, 20 Jun 2018 05:15:43 +0000 Subject: [PATCH] ignore directories --- CHANGELOG.md | 2 ++ pytest_filedata/__init__.py | 3 +++ tests/data/json/empty/test00.json | 0 3 files changed, 5 insertions(+) create mode 100644 tests/data/json/empty/test00.json diff --git a/CHANGELOG.md b/CHANGELOG.md index f5a2251..cbd9462 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ## [Unreleased] ### Added ### Fixed +- ignore directories + ### Changed ### Deprecated ### Removed diff --git a/pytest_filedata/__init__.py b/pytest_filedata/__init__.py index 2aff1c9..a3e161f 100644 --- a/pytest_filedata/__init__.py +++ b/pytest_filedata/__init__.py @@ -89,6 +89,9 @@ def get_filedata(name): raise ValueError("data directory '{}' does not exist".format(dirname)) for each in get_test_files(dirname): + if os.path.isdir(each): + continue + fname = os.path.basename(each) if fname.startswith('.'): continue diff --git a/tests/data/json/empty/test00.json b/tests/data/json/empty/test00.json new file mode 100644 index 0000000..e69de29