Skip to content

refactor session #1145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 5, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
avoid calling __init__ outside of constructor
  • Loading branch information
gaborbernat committed Feb 5, 2019
commit 426c8af63a7afb34325bd0d7c9788575e71577ba
2 changes: 1 addition & 1 deletion src/tox/_pytestplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def logging_levels(self, quiet, verbose):
def newmocksession(mocksession, newconfig):
def newmocksession_(args, source, plugins=()):
config = newconfig(args, source, plugins=plugins)
mocksession.__init__(config)
mocksession._reset(config)
return mocksession

return newmocksession_
Expand Down
1 change: 1 addition & 0 deletions src/tox/package/builder/isolated.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import unicode_literals

import json
from collections import namedtuple

Expand Down
3 changes: 3 additions & 0 deletions src/tox/session/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ class Session(object):
"""The session object that ties together configuration, reporting, venv creation, testing."""

def __init__(self, config, popen=subprocess.Popen):
self._reset(config, popen)

def _reset(self, config, popen=subprocess.Popen):
self.config = config
self.popen = popen
self.resultlog = ResultLog()
Expand Down