Skip to content

Commit

Permalink
Merge pull request #11 from MyGodIsHe/fix-verbose-mode
Browse files Browse the repository at this point in the history
fix verbose mod
  • Loading branch information
MyGodIsHe authored Jan 8, 2022
2 parents f8a2014 + f52797b commit 631f8a6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pytest_neo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
import collections
import curses
import itertools
import multiprocessing
import os
import queue
import random
import sys
import threading
import time

import pytest
from _pytest.terminal import TerminalReporter

__version__ = '0.2.2'
__version__ = '0.2.3'

BLOB_SIZE = (10, 20)
BLOB_SPEED = (0.1, 0.2)
Expand Down Expand Up @@ -258,8 +258,8 @@ def write_fspath_result(self, nodeid, res):
self.write_new_column()

@pytest.hookimpl(trylast=True)
def pytest_sessionstart(self, session):
super(NeoTerminalReporter, self).pytest_sessionstart(session)
def pytest_collection_finish(self, session):
super(NeoTerminalReporter, self).pytest_collection_finish(session)
self.tearup()

def pytest_internalerror(self, excrepr):
Expand Down Expand Up @@ -358,7 +358,7 @@ def can_draw(self, current_time):
return current_time - self._last_draw > self.speed


class VerboseReporter(threading.Thread):
class VerboseReporter(multiprocessing.Process):
REFRESH_INTERVAL = 0.01

def __init__(self, stdscr, speed_min, speed_max):
Expand All @@ -369,8 +369,8 @@ def __init__(self, stdscr, speed_min, speed_max):
self.speed_min = speed_min
self.speed_max = speed_max
self._killed = False
self.queue = queue.Queue()
self.exit = threading.Event()
self.queue = multiprocessing.Queue()
self.exit = multiprocessing.Event()

def run(self):
try:
Expand Down

0 comments on commit 631f8a6

Please sign in to comment.