Skip to content

Commit

Permalink
switch linter to flake8 and minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cgoldberg committed Oct 13, 2016
1 parent e68288d commit c3590ea
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 27 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
language: python
python:
- 2.7
- 3.3
- 3.4
- 3.5
install:
pip install -r requirements.txt
- pip install flake8
before_script:
- flake8 .
script:
python -m unittest discover
- python -m unittest discover
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ystockquote

----

* Created by: Corey Goldberg (2007,2008,2013)
* Created by: Corey Goldberg (2007,2008,2013, 2016)
* License: GNU LGPLv2+
* `Dev Home <https://github.com/cgoldberg/ystockquote>`_
* `PyPI <https://pypi.python.org/pypi/ystockquote>`_
Expand Down Expand Up @@ -37,7 +37,7 @@ You can also clone the development repo to install (requires `git <http://git-sc

To run unit tests::

$ python -m unittest discover
$ tox

~~~~~~~~~~~~~
Example Usage
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

17 changes: 2 additions & 15 deletions test_ystockquote.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Copyright (c) 2013, Corey Goldberg (cgoldberg@gmail.com)
# Copyright (c) 2013,2016 Corey Goldberg (cgoldberg@gmail.com)
#
# license: GNU LGPL
#
Expand All @@ -14,23 +14,10 @@

import unittest

import pep8
from testscenarios import generate_scenarios, TestWithScenarios

import ystockquote


class Pep8ConformanceTestCase(unittest.TestCase):
"""Test that all code conforms to PEP8!"""

def test_pep8_conformance(self):
self.pep8style = pep8.StyleGuide(show_source=True)
files = ('ystockquote.py', 'test_ystockquote.py')
self.pep8style.check_files(files)
self.assertEqual(self.pep8style.options.report.total_errors, 0)


class YStockQuoteTestCase(TestWithScenarios):
class YStockQuoteTestCase(unittest.TestCase):

def test_get_all(self):
symbol = 'GOOG'
Expand Down
10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
# and then run "tox" from this directory.

[tox]
envlist = py27, py35
envlist = flake8, py27, py35

[testenv]
deps =
pep8
testscenarios
commands =
{envpython} -m unittest discover

[testenv:flake8]
basepython=python3
deps=flake8
commands=flake8
7 changes: 5 additions & 2 deletions ystockquote.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# ystockquote : Python module - retrieve stock quote data from Yahoo Finance
#
# Copyright (c) 2007,2008,2013 Corey Goldberg (cgoldberg@gmail.com)
# Copyright (c) 2007,2008,2013,2016 Corey Goldberg (cgoldberg@gmail.com)
#
# license: GNU LGPL
#
Expand All @@ -13,8 +13,10 @@
# Requires: Python 2.7/3.3+


__version__ = '0.2.5dev'
__version__ = '0.2.5dev' # NOQA


import csv
try:
# py3
from urllib.request import Request, urlopen
Expand Down Expand Up @@ -44,6 +46,7 @@ def get_all(symbol):
'1g4mg5m2g6kvjj1j5j3k4f6j6nk5n4ws1xj2va5b6k3t7a2t615l2el3e7v1' \
'e8v7e9s6b4j4p5p6rr2r5r6r7s7'
values = _request(symbol, ids).split(',')
csv
return dict(
dividend_yield=values[0],
dividend_per_share=values[1],
Expand Down

0 comments on commit c3590ea

Please sign in to comment.