Xqt added a comment.
The behaviour on Travis is really strange. I've setted up some print
statements:
def output(self, text, toStdout=False, targetStream=None):
"""Forward text to cache and flush if output is not locked.
All input methods locks the output to a stream but collect them
in cache. They will be printed with next unlocked output call or
at termination time.
"""
print('>>> output:', text)
self.cache_output(text, toStdout=toStdout, targetStream=targetStream)
if not self.lock.locked():
self.flush()
print('<<< output:', text)
def flush(self):
"""Output cached text."""
print('>>> flush:', self.cache.qsize())
if self.cache.qsize() and self.cache.empty():
print('######### SIZE is >0 but QUEUE is EMPTY #####')
while not self.cache.empty():
args, kwargs = self.cache.get_nowait()
print('##>', args)
self.stream_output(*args, **kwargs)
print('##<')
print('<<< flush:', self.cache.qsize())
def cache_output(self, *args, **kwargs):
"""Put text to cache."""
print('>>> cache_output:', self.cache.qsize(), args)
self.cache.put_nowait((args, kwargs))
print('<<< cache_output:', self.cache.qsize(), args)
def stream_output(self, text, toStdout=False, targetStream=None):
"""
Output text to a stream.
"""
print('>>> stream_output:', text, file=sys.stdout, flush=True)
….
print('<<< stream_output:', text)
And found output like this:
tests/ui_tests.py::TestTerminalOutput::test_output
>>> output: output
>>> cache_output: 0 ('output\n',)
<<< cache_output: 1 ('output\n',)
>>> flush: 1
##> ('output\n',)
##<
<<< flush: 0
<<< output: output
FAILED
That looks like `stream_output` is called but does nothing, not even print
the first line which means it is replaced somehow.
TASK DETAIL
https://phabricator.wikimedia.org/T282962
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Xqt
Cc: valhallasw, Aklapper, Xqt, pywikibot-bugs-list, Shalomori123, Lalamarie69,
Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Alter-paule, Beast1978, Un1tY,
Khutuck, Zkhalido, Hook696, Kent7301, joker88john, Viztor, CucyNoiD, Wenyi,
Gaboe420, Giuliamocci, Cpaulf30, Af420, Bsandipan, Tbscho, MayS, Lewizho99,
Mdupont, JJMC89, Maathavan, Dvorapa, Altostratus, Avicennasis, mys_721tx,
jayvdb, Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]