From 98ae25c12cbc5a800579b3f7f24011501d524ca9 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 3 Jun 2018 12:01:09 -0300 Subject: [PATCH 1/3] Fix __init__ declaration --- xdist/scheduler/filescope.py | 2 +- xdist/scheduler/loadscope.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xdist/scheduler/filescope.py b/xdist/scheduler/filescope.py index 6e1f066..b6c0301 100644 --- a/xdist/scheduler/filescope.py +++ b/xdist/scheduler/filescope.py @@ -20,7 +20,7 @@ class LoadFileScheduling(LoadScopeScheduling): This class behaves very much like LoadScopeScheduling, but with a file-level scope. """ - def __init(self, config, log=None): + def __init__(self, config, log=None): super(LoadFileScheduling, self).__init__(config, log) if log is None: self.log = Producer('loadfilesched') diff --git a/xdist/scheduler/loadscope.py b/xdist/scheduler/loadscope.py index 3c8381a..3301133 100644 --- a/xdist/scheduler/loadscope.py +++ b/xdist/scheduler/loadscope.py @@ -6,7 +6,7 @@ from xdist.report import report_collection_diff from xdist.workermanage import parse_spec_config -class LoadScopeScheduling: +class LoadScopeScheduling(object): """Implement load scheduling across nodes, but grouping test by scope. This distributes the tests collected across all nodes so each test is run From fd2e8a67111542e03a1469dee6cfa6bff155b099 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 3 Jun 2018 16:10:24 -0300 Subject: [PATCH 2/3] Make all classes subclass from object --- changelog/297.trivial.rst | 1 + xdist/dsession.py | 4 ++-- xdist/looponfail.py | 4 ++-- xdist/remote.py | 2 +- xdist/scheduler/each.py | 2 +- xdist/scheduler/load.py | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 changelog/297.trivial.rst diff --git a/changelog/297.trivial.rst b/changelog/297.trivial.rst new file mode 100644 index 0000000..8c7688e --- /dev/null +++ b/changelog/297.trivial.rst @@ -0,0 +1 @@ +Make all classes subclass from ``object`` and fix ``super()`` call in ``LoadFileScheduling``; diff --git a/xdist/dsession.py b/xdist/dsession.py index 40ed0af..941715e 100644 --- a/xdist/dsession.py +++ b/xdist/dsession.py @@ -17,7 +17,7 @@ class Interrupted(KeyboardInterrupt): """ signals an immediate interruption. """ -class DSession: +class DSession(object): """A py.test plugin which runs a distributed test session At the beginning of the test session this creates a NodeManager @@ -316,7 +316,7 @@ class DSession: self.config.hook.pytest_runtest_logreport(report=rep) -class TerminalDistReporter: +class TerminalDistReporter(object): def __init__(self, config): self.config = config self.tr = config.pluginmanager.getplugin("terminalreporter") diff --git a/xdist/looponfail.py b/xdist/looponfail.py index 8253f9a..2f97a9d 100644 --- a/xdist/looponfail.py +++ b/xdist/looponfail.py @@ -157,7 +157,7 @@ def init_worker_session(channel, args, option_dict): WorkerFailSession(config, channel).main() -class WorkerFailSession: +class WorkerFailSession(object): def __init__(self, config, channel): self.config = config self.channel = channel @@ -211,7 +211,7 @@ class WorkerFailSession: self.channel.send((trails, failreports, self.collection_failed)) -class StatRecorder: +class StatRecorder(object): def __init__(self, rootdirlist): self.rootdirlist = rootdirlist self.statcache = {} diff --git a/xdist/remote.py b/xdist/remote.py index 346d6e5..0c62c6c 100644 --- a/xdist/remote.py +++ b/xdist/remote.py @@ -14,7 +14,7 @@ import _pytest.hookspec import pytest -class WorkerInteractor: +class WorkerInteractor(object): def __init__(self, config, channel): self.config = config self.workerid = config.workerinput.get('workerid', "?") diff --git a/xdist/scheduler/each.py b/xdist/scheduler/each.py index 578d406..42bc356 100644 --- a/xdist/scheduler/each.py +++ b/xdist/scheduler/each.py @@ -4,7 +4,7 @@ from xdist.workermanage import parse_spec_config from xdist.report import report_collection_diff -class EachScheduling: +class EachScheduling(object): """Implement scheduling of test items on all nodes If a node gets added after the test run is started then it is diff --git a/xdist/scheduler/load.py b/xdist/scheduler/load.py index 02be0d7..eb90bc7 100644 --- a/xdist/scheduler/load.py +++ b/xdist/scheduler/load.py @@ -7,7 +7,7 @@ from xdist.workermanage import parse_spec_config from xdist.report import report_collection_diff -class LoadScheduling: +class LoadScheduling(object): """Implement load scheduling across nodes. This distributes the tests collected across all nodes so each test From b06c52a5d22394f052d35f9a271e5fead579ae9a Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 3 Jun 2018 16:10:55 -0300 Subject: [PATCH 3/3] Add .pytest_cache to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index da1cf7b..162fbd2 100644 --- a/.gitignore +++ b/.gitignore @@ -30,5 +30,6 @@ issue/ pytestdebug.log .tox/ .cache/ +.pytest_cache/ .eggs/ .idea/