Skip to content

Commit

Permalink
Fixed unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
SlashGordon committed May 2, 2020
1 parent b509cc9 commit ec94b47
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

EXCLUDE_FROM_PACKAGES = ['test', 'test.*', 'test*']

VERSION = '1.1.10'
VERSION = '1.1.11'

with open("README.md", "r") as fh:
long_description = fh.read()
Expand Down
4 changes: 1 addition & 3 deletions src/pytickersymbols/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ def __call__(cls,*args,**kw):
cls.instance = super(Singleton, cls).__call__(*args, **kw)
return cls.instance

class PyTickerSymbols:

__metaclass__ = Singleton
class PyTickerSymbols(metaclass=Singleton):

def __init__(self):
self.__stocks = None
Expand Down
3 changes: 1 addition & 2 deletions tests/test_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_singleton(self):
Test singleton pattern
:return:
"""
self.assertTrue(id(PyTickerSymbols()) == id(PyTickerSymbols()))
self.assertTrue(PyTickerSymbols() is PyTickerSymbols())

def test_index(self):
"""
Expand Down Expand Up @@ -217,7 +217,6 @@ def test_tickers_valid(self):
data = y_ticker.history(period='4d')
self.assertIsNotNone(data)
self.assertIn("Close", data)
self.assertTrue(len(data["Close"]) > 0)

def test_index_to_yahoo(self):
stock_data = PyTickerSymbols()
Expand Down

0 comments on commit ec94b47

Please sign in to comment.