Skip to content

Commit

Permalink
Allow injecting tracer factory to the Query class
Browse files Browse the repository at this point in the history
Trying to allow sphinx autodoc the query module on readthedocs.org
  • Loading branch information
FrostyX committed Mar 10, 2015
1 parent 2c22255 commit 2e104a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
class TestQuery(unittest.TestCase):

def setUp(self):
self.query = Query()
self.query._tracer = TracerMock()
self.query = Query(tracer=TracerMock)

def test_affected_applications(self):
apps_query = self.query.affected_applications()
Expand Down
3 changes: 2 additions & 1 deletion tracer/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class Query(object):
"""

_tracer = Tracer(System.package_manager(), Rules, Applications, dump_memory)
def __init__(self, tracer=Tracer):
self._tracer = tracer(System.package_manager(), Rules, Applications, dump_memory)

def affected_applications(self, user=None):
"""
Expand Down

0 comments on commit 2e104a2

Please sign in to comment.