Replace get_populated_generator with setUpClass
More refactoring for test_generators

- list comprehensions for distill_articles/pages
- distill articles only once
- pep8
Refactor pelican_open using contextmanager
Merge pull request #1007 from saimn/refactor-tests

Refactor test_generators and pelican_open