MalloyDelacroix / DownloaderForReddit

The Downloader for Reddit is a GUI application with some advanced features to extract and download submitted content from reddit.
GNU General Public License v3.0
514 stars 48 forks source link

Rename test files so unittest can find them #40

Closed crccheck closed 6 years ago

crccheck commented 6 years ago

According to the wiki, you run the tests with python -m unittest. Unfortunately, the way the files are named, you'll get Ran 0 tests in 0.000s. This fixes the test names to follow what unittest is expecting. While it's possible to adjust the pattern (-p PATTERN, --pattern PATTERN Pattern to match tests ('test*.py' default))) there's no good reason to break with Python style.

With this change, you'll get:

$ python -m unittest
........................................................./Users/crccheck/env/DownloaderForReddit/lib/python3.7/site-packages/bs4/element.py:1601: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  if (isinstance(value, str) or isinstance(value, collections.Callable) or hasattr(value, 'match')
..
----------------------------------------------------------------------
Ran 59 tests in 0.064s

This breaks filename convention with the style guide, but there's no reason to fight against the Python ecosystem just to name files a certain way.