Skip to content

bpo-42789: Don't skip curses tests on non-tty. #24009

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 2 commits into from
Jan 2, 2021

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Dec 30, 2020

If __stdout__ is not attached to terminal, try to use __stderr__ if it is attached to terminal, or open the terminal device, or use regular file as terminal, but some functions will be untested in the latter case.

https://bugs.python.org/issue42789

If __stdout__ is not attached to terminal, try to use __stderr__
if it is attached to terminal, or open the terminal device, or
use regular file as terminal, but some functions will be untested
in the latter case.
@serhiy-storchaka serhiy-storchaka merged commit 607501a into python:master Jan 2, 2021
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 607501abb488fb37e33cf9d35260ab7baefa192f 3.9

@miss-islington
Copy link
Contributor

Sorry @serhiy-storchaka, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 607501abb488fb37e33cf9d35260ab7baefa192f 3.8

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Debian 3.x has failed when building commit 607501a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/49/builds/623) and take a look at the build logs.
  4. Check if the failure is related to this commit (607501a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/49/builds/623

Failed tests:

  • test_curses

Failed subtests:

  • test_colors_funcs - test.test_curses.TestCurses

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

411 tests OK.

10 slowest tests:

  • test_concurrent_futures: 3 min 1 sec
  • test_multiprocessing_spawn: 1 min 30 sec
  • test_gdb: 1 min 16 sec
  • test_capi: 1 min 10 sec
  • test_tokenize: 1 min 7 sec
  • test_unparse: 1 min 5 sec
  • test_asyncio: 1 min 5 sec
  • test_multiprocessing_forkserver: 1 min 4 sec
  • test_peg_generator: 57.6 sec
  • test_multiprocessing_fork: 57.0 sec

1 test failed:
test_curses

14 tests skipped:
test_dbm_ndbm test_devpoll test_ioctl test_kqueue test_msilib
test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly
test_winconsoleio test_winreg test_winsound test_zipfile64

1 re-run test:
test_curses

Total duration: 5 min 4 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/test_curses.py", line 316, in test_colors_funcs
    curses.pair_content(curses.COLOR_PAIRS - 1)
_curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1)

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jan 3, 2021
If __stdout__ is not attached to terminal, try to use __stderr__
if it is attached to terminal, or open the terminal device, or
use regular file as terminal, but some functions will be untested
in the latter case..
(cherry picked from commit 607501a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

GH-24076 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Jan 3, 2021
serhiy-storchaka added a commit that referenced this pull request Jan 3, 2021
…4076)

If __stdout__ is not attached to terminal, try to use __stderr__
if it is attached to terminal, or open the terminal device, or
use regular file as terminal, but some functions will be untested
in the latter case.
(cherry picked from commit 607501a)
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Debian 3.9 has failed when building commit 0303008.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/32/builds/237) and take a look at the build logs.
  4. Check if the failure is related to this commit (0303008) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/32/builds/237

Failed tests:

  • test_curses

Failed subtests:

  • test_colors_funcs - test.test_curses.TestCurses

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

410 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 53 sec
  • test_multiprocessing_spawn: 1 min 27 sec
  • test_gdb: 1 min 24 sec
  • test_tokenize: 1 min 16 sec
  • test_multiprocessing_forkserver: 1 min 5 sec
  • test_unparse: 1 min 5 sec
  • test_peg_generator: 1 min 2 sec
  • test_asyncio: 59.8 sec
  • test_capi: 53.7 sec
  • test_multiprocessing_fork: 53.5 sec

1 test failed:
test_curses

14 tests skipped:
test_dbm_ndbm test_devpoll test_ioctl test_kqueue test_msilib
test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly
test_winconsoleio test_winreg test_winsound test_zipfile64

1 re-run test:
test_curses

Total duration: 5 min 21 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.9.edelsohn-debian-z/build/Lib/test/test_curses.py", line 314, in test_colors_funcs
    curses.pair_content(min(curses.COLOR_PAIRS - 1, 0x7fff))
_curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1)

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL8 3.9 has failed when building commit 0303008.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/490/builds/229) and take a look at the build logs.
  4. Check if the failure is related to this commit (0303008) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/490/builds/229

Failed tests:

  • test_curses

Failed subtests:

  • test_colors_funcs - test.test_curses.TestCurses

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

410 tests OK.

10 slowest tests:

  • test_concurrent_futures: 3 min 15 sec
  • test_multiprocessing_spawn: 1 min 24 sec
  • test_unparse: 1 min 10 sec
  • test_tokenize: 1 min 9 sec
  • test_multiprocessing_forkserver: 1 min 7 sec
  • test_gdb: 1 min 7 sec
  • test_capi: 1 min 7 sec
  • test_peg_generator: 1 min 2 sec
  • test_asyncio: 1 min
  • test_signal: 59.1 sec

1 test failed:
test_curses

14 tests skipped:
test_devpoll test_ioctl test_kqueue test_msilib test_nis
test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly
test_winconsoleio test_winreg test_winsound test_zipfile64

1 re-run test:
test_curses

Total duration: 5 min 46 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.9.edelsohn-rhel8-z/build/Lib/test/test_curses.py", line 314, in test_colors_funcs
    curses.pair_content(min(curses.COLOR_PAIRS - 1, 0x7fff))
_curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1)

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL8 LTO + PGO 3.9 has failed when building commit 0303008.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/436/builds/457) and take a look at the build logs.
  4. Check if the failure is related to this commit (0303008) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/436/builds/457

Failed tests:

  • test_curses

Failed subtests:

  • test_colors_funcs - test.test_curses.TestCurses

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

409 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 40 sec
  • test_multiprocessing_spawn: 1 min 7 sec
  • test_multiprocessing_forkserver: 59.4 sec
  • test_multiprocessing_fork: 52.5 sec
  • test_signal: 47.0 sec
  • test_asyncio: 44.5 sec
  • test_io: 35.4 sec
  • test_imaplib: 32.4 sec
  • test_pydoc: 31.0 sec
  • test_faulthandler: 28.0 sec

1 test failed:
test_curses

15 tests skipped:
test_devpoll test_gdb test_ioctl test_kqueue test_msilib test_nis
test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly
test_winconsoleio test_winreg test_winsound test_zipfile64

1 re-run test:
test_curses

Total duration: 4 min 37 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.9.edelsohn-rhel8-z.lto-pgo/build/Lib/test/test_curses.py", line 314, in test_colors_funcs
    curses.pair_content(min(curses.COLOR_PAIRS - 1, 0x7fff))
_curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1)

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jan 3, 2021
…24009) (pythonGH-24076)

If __stdout__ is not attached to terminal, try to use __stderr__
if it is attached to terminal, or open the terminal device, or
use regular file as terminal, but some functions will be untested
in the latter case.
(cherry picked from commit 607501a).
(cherry picked from commit 0303008)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL8 LTO 3.9 has failed when building commit 0303008.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/281/builds/413) and take a look at the build logs.
  4. Check if the failure is related to this commit (0303008) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/281/builds/413

Failed tests:

  • test_curses

Failed subtests:

  • test_colors_funcs - test.test_curses.TestCurses

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

410 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 47 sec
  • test_peg_generator: 2 min 38 sec
  • test_gdb: 1 min 40 sec
  • test_multiprocessing_spawn: 1 min 12 sec
  • test_multiprocessing_forkserver: 1 min 1 sec
  • test_multiprocessing_fork: 52.8 sec
  • test_asyncio: 48.7 sec
  • test_signal: 47.1 sec
  • test_io: 33.8 sec
  • test_tokenize: 32.3 sec

1 test failed:
test_curses

14 tests skipped:
test_devpoll test_ioctl test_kqueue test_msilib test_nis
test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly
test_winconsoleio test_winreg test_winsound test_zipfile64

1 re-run test:
test_curses

Total duration: 6 min 8 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.9.edelsohn-rhel8-z.lto/build/Lib/test/test_curses.py", line 314, in test_colors_funcs
    curses.pair_content(min(curses.COLOR_PAIRS - 1, 0x7fff))
_curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1)

serhiy-storchaka added a commit that referenced this pull request Jan 3, 2021
…GH-24076) (GH-24078)

If __stdout__ is not attached to terminal, try to use __stderr__
if it is attached to terminal, or open the terminal device, or
use regular file as terminal, but some functions will be untested
in the latter case.
(cherry picked from commit 607501a)
(cherry picked from commit 0303008)
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL8 3.8 has failed when building commit 645174a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/119/builds/153) and take a look at the build logs.
  4. Check if the failure is related to this commit (645174a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/119/builds/153

Failed tests:

  • test_curses

Failed subtests:

  • test_colors_funcs - test.test_curses.TestCurses

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

408 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 52 sec
  • test_multiprocessing_spawn: 1 min 47 sec
  • test_multiprocessing_fork: 1 min 28 sec
  • test_multiprocessing_forkserver: 1 min 19 sec
  • test_tools: 1 min 5 sec
  • test_tokenize: 1 min 1 sec
  • test_gdb: 50.2 sec
  • test_asyncio: 49.2 sec
  • test_lib2to3: 45.7 sec
  • test_capi: 42.5 sec

1 test failed:
test_curses

14 tests skipped:
test_devpoll test_ioctl test_kqueue test_msilib test_nis
test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly
test_winconsoleio test_winreg test_winsound test_zipfile64

1 re-run test:
test_curses

Total duration: 5 min 21 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.8.edelsohn-rhel8-z/build/Lib/test/test_curses.py", line 310, in test_colors_funcs
    curses.pair_content(min(curses.COLOR_PAIRS - 1, 0x7fff))
_curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1)

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL8 LTO + PGO 3.8 has failed when building commit 645174a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/534/builds/428) and take a look at the build logs.
  4. Check if the failure is related to this commit (645174a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/534/builds/428

Failed tests:

  • test_curses

Failed subtests:

  • test_colors_funcs - test.test_curses.TestCurses

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

407 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 30 sec
  • test_multiprocessing_spawn: 1 min 30 sec
  • test_multiprocessing_forkserver: 1 min 12 sec
  • test_multiprocessing_fork: 1 min 8 sec
  • test_asyncio: 42.3 sec
  • test_io: 35.6 sec
  • test_subprocess: 29.4 sec
  • test_faulthandler: 28.8 sec
  • test_socket: 28.6 sec
  • test_tokenize: 27.3 sec

1 test failed:
test_curses

15 tests skipped:
test_devpoll test_gdb test_ioctl test_kqueue test_msilib test_nis
test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly
test_winconsoleio test_winreg test_winsound test_zipfile64

1 re-run test:
test_curses

Total duration: 3 min 28 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.8.edelsohn-rhel8-z.lto-pgo/build/Lib/test/test_curses.py", line 310, in test_colors_funcs
    curses.pair_content(min(curses.COLOR_PAIRS - 1, 0x7fff))
_curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1)

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL8 LTO 3.8 has failed when building commit 645174a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/109/builds/430) and take a look at the build logs.
  4. Check if the failure is related to this commit (645174a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/109/builds/430

Failed tests:

  • test_curses

Failed subtests:

  • test_colors_funcs - test.test_curses.TestCurses

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

408 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 32 sec
  • test_multiprocessing_spawn: 1 min 33 sec
  • test_gdb: 1 min 18 sec
  • test_multiprocessing_forkserver: 1 min 14 sec
  • test_multiprocessing_fork: 1 min 8 sec
  • test_asyncio: 42.3 sec
  • test_io: 33.5 sec
  • test_tokenize: 33.0 sec
  • test_socket: 28.8 sec
  • test_faulthandler: 28.2 sec

1 test failed:
test_curses

14 tests skipped:
test_devpoll test_ioctl test_kqueue test_msilib test_nis
test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly
test_winconsoleio test_winreg test_winsound test_zipfile64

1 re-run test:
test_curses

Total duration: 4 min 7 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.8.edelsohn-rhel8-z.lto/build/Lib/test/test_curses.py", line 310, in test_colors_funcs
    curses.pair_content(min(curses.COLOR_PAIRS - 1, 0x7fff))
_curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1)

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
If __stdout__ is not attached to terminal, try to use __stderr__
if it is attached to terminal, or open the terminal device, or
use regular file as terminal, but some functions will be untested
in the latter case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants