Add runtests invoke task.
-from invoke import task
+from invoke import task, run
from jinja2 import Environment, FileSystemLoader
import requests
@@ -39,6 +39,16 @@ def genspider(ctx, name, domain, start_urls=None):
print('Created {0}'.format(f))
+@task
+def runtests(ctx):
+ """
+ Runs pytest, pyflakes, and pep8.
+ """
+ run('pytest', pty=True)
+ run('pyflakes .', pty=True)
+ run('pep8 --ignore E265,E266,E501 .', pty=True)
+
+
def _make_classname(name):
return '{0}Spider'.format(name.capitalize())
