summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Smith <zd@zdsmith.com>2016-04-04 22:02:05 -0400
committerZach Smith <zd@zdsmith.com>2016-04-04 22:02:05 -0400
commit65b889d5fae4e73a5e5589c582f0ac81415d9cbf (patch)
tree233901b75322482f9ee185cd7d3bfa24bee79fe3
parent1479ee55fa80196d914c1e683f2c379edb9a8a0a (diff)
downloadpycco-flatten-reformat.tar.gz
-rw-r--r--pycco/main.py4
-rw-r--r--tests/test_pycco.py7
2 files changed, 6 insertions, 5 deletions
diff --git a/pycco/main.py b/pycco/main.py
index a02eee2..27f0721 100644
--- a/pycco/main.py
+++ b/pycco/main.py
@@ -456,6 +456,7 @@ highlight_start = "<div class=\"highlight\"><pre>"
# The end of each Pygments highlight block.
highlight_end = "</pre></div>"
+
def _flatten_sources(sources):
"""
This function will iterate through the list of sources and if a directory
@@ -466,14 +467,13 @@ def _flatten_sources(sources):
for source in sources:
if os.path.isdir(source):
for dirpath, _, filenames in os.walk(source):
- _sources.extend([os.path.join(dirpath,f) for f in filenames])
+ _sources.extend([os.path.join(dirpath, f) for f in filenames])
else:
_sources.append(source)
return _sources
-
def process(sources, preserve_paths=True, outdir=None, language=None, encoding="utf8", index=False):
"""For each source file passed as argument, generate the documentation."""
diff --git a/tests/test_pycco.py b/tests/test_pycco.py
index ae7d0e4..1c1acb8 100644
--- a/tests/test_pycco.py
+++ b/tests/test_pycco.py
@@ -1,10 +1,10 @@
import copy
-import os
+import os.path
import tempfile
import time
-import os.path
+
import pytest
-from hypothesis import given, example, assume
+from hypothesis import given, example
from hypothesis.strategies import lists, text, booleans, choices, none
import pycco.generate_index as generate_index
@@ -162,6 +162,7 @@ def test_generate_index(path_lists, outdir_list):
outdir = os.path.join(*outdir_list)
generate_index.generate_index(file_paths, outdir=outdir)
+
def test_flatten_sources(tmpdir):
sources = [str(tmpdir)]
expected_sources = []