Skip to content
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

pythonPackages.asciimatics: init at 1.10.0 #54404

Merged
merged 1 commit into from Jan 23, 2019

Conversation

CMCDragonkai
Copy link
Member

@CMCDragonkai CMCDragonkai commented Jan 21, 2019

Motivation for this change

Asciimatics is a package to help people create full-screen text UIs (from interactive forms to ASCII animations) on any platform.

This package only has a wheel on Pypi, and I don't understand how to execute its tests. So I don't have a specified checkPhase.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@worldofpeace
Copy link
Contributor

This package only has a wheel on Pypi, and I don't understand how to execute its tests. So I don't have a specified checkPhase.

@CMCDragonkai
Copy link
Member Author

Should I remove the checkInputs then? Also I notice that pytestrunner is actually part of setup_requires so that should be in buildInputs and not propagatedBuildInputs right?

@worldofpeace
Copy link
Contributor

Should I remove the checkInputs then?

I think you can leave them in the possibility of a tarball being distributed.

Also I notice that pytestrunner is actually part of setup_requires so that should be in buildInputs and not propagatedBuildInputs right?

See #54403 (review)

@CMCDragonkai
Copy link
Member Author

CMCDragonkai commented Jan 22, 2019

Tests now run, however they fail

Here's the output log

replacing old 'python3.6-asciimatics-1.10.0'
installing 'python3.6-asciimatics-1.10.0'
these derivations will be built:
  /nix/store/gxqh0j0d458xmr9mc1206crg196z682q-python3.6-asciimatics-1.10.0.drv
building '/nix/store/gxqh0j0d458xmr9mc1206crg196z682q-python3.6-asciimatics-1.10.0.drv'...
unpacking sources
unpacking source archive /nix/store/vffcafv657p5wi88srd7gnhfsf4mla1p-asciimatics-1.10.0.tar.gz
source root is asciimatics-1.10.0
setting SOURCE_DATE_EPOCH to timestamp 1548070409 of file asciimatics-1.10.0/setup.cfg
patching sources
configuring
building
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/asciimatics
copying asciimatics/__init__.py -> build/lib/asciimatics
copying asciimatics/effects.py -> build/lib/asciimatics
copying asciimatics/sprites.py -> build/lib/asciimatics
copying asciimatics/scene.py -> build/lib/asciimatics
copying asciimatics/screen.py -> build/lib/asciimatics
copying asciimatics/version.py -> build/lib/asciimatics
copying asciimatics/renderers.py -> build/lib/asciimatics
copying asciimatics/utilities.py -> build/lib/asciimatics
copying asciimatics/paths.py -> build/lib/asciimatics
copying asciimatics/widgets.py -> build/lib/asciimatics
copying asciimatics/event.py -> build/lib/asciimatics
copying asciimatics/exceptions.py -> build/lib/asciimatics
copying asciimatics/particles.py -> build/lib/asciimatics
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/__init__.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/screen.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/widgets.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/version.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/scene.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/renderers.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/utilities.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/paths.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/exceptions.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/effects.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/sprites.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/event.py -> build/bdist.linux-x86_64/wheel/asciimatics
copying build/lib/asciimatics/particles.py -> build/bdist.linux-x86_64/wheel/asciimatics
running install_egg_info
running egg_info
writing asciimatics.egg-info/PKG-INFO
writing dependency_links to asciimatics.egg-info/dependency_links.txt
writing requirements to asciimatics.egg-info/requires.txt
writing top-level names to asciimatics.egg-info/top_level.txt
reading manifest file 'asciimatics.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'asciimatics.egg-info/SOURCES.txt'
Copying asciimatics.egg-info to build/bdist.linux-x86_64/wheel/asciimatics-1.10.0-py3.6.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/asciimatics-1.10.0.dist-info/WHEEL
creating 'dist/asciimatics-1.10.0-py2.py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'asciimatics/__init__.py'
adding 'asciimatics/effects.py'
adding 'asciimatics/event.py'
adding 'asciimatics/exceptions.py'
adding 'asciimatics/particles.py'
adding 'asciimatics/paths.py'
adding 'asciimatics/renderers.py'
adding 'asciimatics/scene.py'
adding 'asciimatics/screen.py'
adding 'asciimatics/sprites.py'
adding 'asciimatics/utilities.py'
adding 'asciimatics/version.py'
adding 'asciimatics/widgets.py'
adding 'asciimatics-1.10.0.dist-info/LICENSE'
adding 'asciimatics-1.10.0.dist-info/METADATA'
adding 'asciimatics-1.10.0.dist-info/WHEEL'
adding 'asciimatics-1.10.0.dist-info/top_level.txt'
adding 'asciimatics-1.10.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
installing
/build/asciimatics-1.10.0/dist /build/asciimatics-1.10.0
Processing ./asciimatics-1.10.0-py2.py3-none-any.whl
Requirement already satisfied: pyfiglet>=0.7.2 in /nix/store/av47rqj3aj7ikywvd8h73rdb2x7dqg8p-python3.6-pyfiglet-0.8.post0/lib/python3.6/site-packages (from asciimatics==1.10.0) (0.8.post0)
Requirement already satisfied: Pillow>=2.7.0 in /nix/store/m3n3mh02b675q24xdcxwxlqb00pr6902-python3.6-Pillow-5.3.0/lib/python3.6/site-packages (from asciimatics==1.10.0) (5.3.0)
Requirement already satisfied: future in /nix/store/5n09grgpzilg7ihk86p9jnqnlpgk8a9a-python3.6-future-0.17.1/lib/python3.6/site-packages (from asciimatics==1.10.0) (0.17.1)
Requirement already satisfied: wcwidth in /nix/store/22bg72f225ffqk7n1k6h8ff664fap2m8-python3.6-wcwidth-0.1.7/lib/python3.6/site-packages (from asciimatics==1.10.0) (0.1.7)
Installing collected packages: asciimatics
Successfully installed asciimatics-1.10.0
/build/asciimatics-1.10.0
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/c5iw69jjnln6csrawm7dm2zxrfchwp5h-python3.6-asciimatics-1.10.0
strip is /nix/store/3xwc1ip20b0p68sxqbjjll0va4pv5hbv-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/c5iw69jjnln6csrawm7dm2zxrfchwp5h-python3.6-asciimatics-1.10.0/lib
patching script interpreter paths in /nix/store/c5iw69jjnln6csrawm7dm2zxrfchwp5h-python3.6-asciimatics-1.10.0
checking for references to /build/ in /nix/store/c5iw69jjnln6csrawm7dm2zxrfchwp5h-python3.6-asciimatics-1.10.0...
running install tests
running test
running egg_info
writing asciimatics.egg-info/PKG-INFO
writing dependency_links to asciimatics.egg-info/dependency_links.txt
writing requirements to asciimatics.egg-info/requires.txt
writing top-level names to asciimatics.egg-info/top_level.txt
reading manifest file 'asciimatics.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'asciimatics.egg-info/SOURCES.txt'
running build_ext
/build/asciimatics-1.10.0/tests/test_renderers.py:91: DeprecationWarning: invalid escape sequence \
  "| '_ \ / _ \ | |/ _ \ \n" +
/build/asciimatics-1.10.0/tests/test_renderers.py:93: DeprecationWarning: invalid escape sequence \_
  "|_| |_|\___|_|_|\___/ \n" +
test_banner (tests.test_effects.TestEffects)
Check that BannerText works. ... ok
test_clock (tests.test_effects.TestEffects)
Check that Clock works. ... ok
test_cog (tests.test_effects.TestEffects)
Check that Cog works. ... ok
test_cycle (tests.test_effects.TestEffects)
Check that Cycle works. ... ok
test_julia (tests.test_effects.TestEffects)
Check that Julia works. ... ok
test_matrix (tests.test_effects.TestEffects)
Check that the Matrix works. ... ok
test_mirage (tests.test_effects.TestEffects)
Check that Mirage works. ... ok
test_noise (tests.test_effects.TestEffects)
Check that RandomNoise works. ... ok
test_print (tests.test_effects.TestEffects)
Check that the Print Effect works. ... ok
test_scroll (tests.test_effects.TestEffects)
Check that Scroll works. ... ok
test_snow (tests.test_effects.TestEffects)
Check that Snow works. ... ok
test_sprite (tests.test_effects.TestEffects)
Check that Sprites work. ... ok
test_sprite_overlap (tests.test_effects.TestEffects)
Check that Sprites detect overlap. ... ok
test_stars (tests.test_effects.TestEffects)
Check that Stars works. ... ok
test_text_effects (tests.test_effects.TestEffects)
Check effects can be played. ... ERROR
test_wipe (tests.test_effects.TestEffects)
Check that Wipe works. ... ok
test_keyboard_event (tests.test_events.TestEvents)
Check Keyboard event is consistent. ... ok
test_mouse_event (tests.test_events.TestEvents)
Check Mouse event is consistent. ... ok
test_resize (tests.test_exceptions.TestExceptions)
Check that we can create a ResizeScreenError ... ok
test_stop_app (tests.test_exceptions.TestExceptions)
Check that we can create a StopApplication. ... ok
test_drop_screen (tests.test_particles.TestParticles)
Test that DropScreen works as expected. ... ok
test_explosion (tests.test_particles.TestParticles)
Test that Explosion works as expected. ... ok
test_palm_firework (tests.test_particles.TestParticles)
Test that PalmFirework works as expected. ... ok
test_rain (tests.test_particles.TestParticles)
Test that Rain works as expected. ... ok
test_ring_firework (tests.test_particles.TestParticles)
Test that RingFirework works as expected. ... ok
test_serpent_firework (tests.test_particles.TestParticles)
Test that SerpentFirework works as expected. ... ok
test_shoot_screen (tests.test_particles.TestParticles)
Test that ShootScreen works as expected. ... ok
test_star_firework (tests.test_particles.TestParticles)
Test that StarFirework works as expected. ... ok
test_dynamic_path (tests.test_paths.TestPaths)
Check a dynamic path works as expected. ... ok
test_jump_and_wait (tests.test_paths.TestPaths)
Check basic movement of cursor works. ... ok
test_spline (tests.test_paths.TestPaths)
Check a path works with a spline curve. ... ok
test_straight_lines (tests.test_paths.TestPaths)
Check a path works in straight lines. ... ok
test_bar_chart (tests.test_renderers.TestRenderers)
Check that the BarChart renderer works. ... ok
test_box (tests.test_renderers.TestRenderers)
Check that the Box renderer works. ... ok
test_bubble (tests.test_renderers.TestRenderers)
Check that the SpeechBubble renderer works. ... ok
test_colour_image_file (tests.test_renderers.TestRenderers)
Check that the ColourImageFile renderer works. ... ERROR
test_colour_maps (tests.test_renderers.TestRenderers)
Check that the ${} syntax is parsed correctly. ... ok
test_figlet (tests.test_renderers.TestRenderers)
Check that the Figlet renderer works. ... ok
test_fire (tests.test_renderers.TestRenderers)
Check that the Fire renderer works. ... ok
test_height (tests.test_renderers.TestRenderers)
Check that the max_height property works. ... ok
test_image_files (tests.test_renderers.TestRenderers)
Check that the ImageFile renderer works. ... FAIL
test_images (tests.test_renderers.TestRenderers)
Check that the images property works. ... ok
test_kaleidoscope (tests.test_renderers.TestRenderers)
Check that the Kaleidoscope renderer works. ... ok
test_plasma (tests.test_renderers.TestRenderers)
Check that the Plasma renderer works. ... ok
test_rainbow (tests.test_renderers.TestRenderers)
Check that the Rainbow renderer works. ... ERROR
test_repr (tests.test_renderers.TestRenderers)
Check that the string representation works. ... ok
test_rotated_dup (tests.test_renderers.TestRenderers)
Check that the RotatedDuplicate renderer works. ... ok
test_uni_image_files (tests.test_renderers.TestRenderers)
Check that the unicode ColourImageFile rendering works. ... ERROR
test_width (tests.test_renderers.TestRenderers)
Check that the max_width property works. ... ok
test_dynamic_effects (tests.test_scene.TestScene)
Check adding and removing effects works. ... ok
test_events (tests.test_scene.TestScene)
Check event processing is queued correctly. ... ok
test_properties (tests.test_scene.TestScene)
Check properties work as expected. ... ok
test_save (tests.test_scene.TestScene)
Check scene will save data on exit if needed. ... ok
test_catch_exceptions (tests.test_screen.TestScreen)
Check that we can catch exceptions (e.g. for ctrl-c). ... ERROR
test_centre (tests.test_screen.TestScreen)
Check that centre works as expected. ... ERROR
test_cjk_glyphs (tests.test_screen.TestScreen)
Check that CJK languages track double-width glyphs as expected. ... ERROR
test_cjk_glyphs_overwrite (tests.test_screen.TestScreen)
Check that CJK languages delete half-glyphs correctly. ... ERROR
test_ctrl (tests.test_screen.TestScreen)
Check that ctrl returns the right values. ... ERROR
test_draw (tests.test_screen.TestScreen)
Check that line drawing works as expected. ... ERROR
test_forced_update (tests.test_screen.TestScreen)
Check that forcing an update works as expected. ... ERROR
test_highlight (tests.test_screen.TestScreen)
Check that highlight works as expected. ... ERROR
test_key_input (tests.test_screen.TestScreen)
Check that keyboard input works. ... ERROR
test_last_pos (tests.test_screen.TestScreen)
Check that screen drawing is efficient and unaffected by draw. ... ERROR
test_limits (tests.test_screen.TestScreen)
Check that get_from and print_at limit checking works. ... ERROR
test_mouse_input (tests.test_screen.TestScreen)
Check that mouse input works. ... ERROR
test_next_scene (tests.test_screen.TestScreen)
Check that we can play multiple Scenes. ... ERROR
test_open_close (tests.test_screen.TestScreen)
Check Screen.open works. ... ERROR
test_origin (tests.test_screen.TestScreen)
Check that Canvas origin is correct. ... ERROR
test_paint (tests.test_screen.TestScreen)
Check that paint with colour map works. ... ERROR
test_palette (tests.test_screen.TestScreen)
Check that we have a valid colour palette. ... ERROR
test_play (tests.test_screen.TestScreen)
Check that we can play a basic Effect in a Scene. ... ERROR
test_polygons (tests.test_screen.TestScreen)
Check that filled polygons work as expected. ... ERROR
test_print_and_get (tests.test_screen.TestScreen)
Check that basic print_at and get_from work as expected. ... ERROR
test_putch_and_getch (tests.test_screen.TestScreen)
Check deprecated features still work. ... ERROR
test_refresh (tests.test_screen.TestScreen)
Check that refresh works. ... ERROR
test_save_signal_state (tests.test_screen.TestScreen)
Tests that the signal state class works properly. ... ERROR
test_scroll (tests.test_screen.TestScreen)
Check that scrolling works as expected. ... ERROR
test_scroll_redraw (tests.test_screen.TestScreen)
Check that scrolling works with screen locations. ... ERROR
test_signal (tests.test_screen.TestScreen)
Check that signals are restored after using _CursesScreen ... ERROR
test_title (tests.test_screen.TestScreen)
Check that we can change the screen title. ... ERROR
test_unhandled_events (tests.test_screen.TestScreen)
Check that default handling of events works as documented. ... ERROR
test_visible (tests.test_screen.TestScreen)
Check that is_visible works as expected. ... ERROR
test_windows_input (tests.test_screen.TestScreen)
Check that extended keyboard input works on Windows. ... ERROR
test_wrapper (tests.test_screen.TestScreen)
Check that you can create a blank Screen. ... ERROR
test_wrapper_return (tests.test_screen.TestScreen)
Check that you get the result back from the wrapped function. ... ERROR
test_init (tests.test_sprites.TestSprites) ... ok
test_readable_mem (tests.test_utilities.TestWidgets)
Check readable_mem works as expected. ... /build/asciimatics-1.10.0/tests/test_utilities.py:19: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals("9999", readable_mem(9999))
ok
test_readable_timestamp (tests.test_utilities.TestWidgets)
Check readable_timestamp works as expected. ... ok
test_background (tests.test_widgets.TestWidgets)
Check Background widget works as expected. ... /build/asciimatics-1.10.0/tests/test_widgets.py:1897: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(char, ord(" "))
ok
test_change_values (tests.test_widgets.TestWidgets)
Check changing Text values resets cursor position. ... ok
test_checkbox_input (tests.test_widgets.TestWidgets)
Check Checkbox input works as expected. ... ok
test_cjk_forms (tests.test_widgets.TestWidgets)
Check form widgets work with CJK characters. ... ok
test_cjk_popup (tests.test_widgets.TestWidgets)
Check PopUpDialog widgets work with CJK double-width characters. ... ok
test_clone (tests.test_widgets.TestWidgets)
Check Frame cloning works. ... ok
test_cpu_saving (tests.test_widgets.TestWidgets)
Check Frame rate limiting is even more extreme when in cpu saving mode. ... ok
test_date_picker (tests.test_widgets.TestWidgets)
Check DatePicker widget works as expected. ... ok
test_disabled_text (tests.test_widgets.TestWidgets)
Check disabled TextBox can be used for pre-formatted output. ... ok
test_dropdown_list (tests.test_widgets.TestWidgets)
Check DropdownList widget works as expected. ... ok
test_dropdown_list_options (tests.test_widgets.TestWidgets)
Check DropdownList widget extra features work. ... ok
test_empty_frame (tests.test_widgets.TestWidgets)
Check empty Frames still work. ... ok
test_file_browser (tests.test_widgets.TestWidgets)
Check FileBrowser widget works as expected. ... ok
test_find_min_start (tests.test_widgets.TestWidgets)
Check _find_min_start works as expected. ... ok
test_find_widget (tests.test_widgets.TestWidgets)
Check find_widget works as expected. ... ok
test_focus_callback (tests.test_widgets.TestWidgets)
Check that the _on_focus & _on_blur callbacks work as expected. ... ok
test_form_data (tests.test_widgets.TestWidgets)
Check Frame.data works as expected. ... ok
test_form_input (tests.test_widgets.TestWidgets)
Check Frame input works as expected. ... ok
test_frame_focus_widget_property (tests.test_widgets.TestWidgets)
Check the frame exposes the focussed widget ... ok
test_frame_focus_widget_property_when_frame_focussed (tests.test_widgets.TestWidgets)
check the frame exposes nothing when frame is foccused ... ok
test_frame_rate (tests.test_widgets.TestWidgets)
Check Frame rate limiting works as expected. ... ok
test_frame_themes (tests.test_widgets.TestWidgets)
Check we can set a colour theme for a Frame. ... ok
test_label_alignment (tests.test_widgets.TestWidgets)
Check Label alignment works. ... ok
test_label_change (tests.test_widgets.TestWidgets)
Check Labels can be dynamically updated. ... ok
test_label_height (tests.test_widgets.TestWidgets)
Check Labels can be dynamically updated. ... ok
test_line_flow (tests.test_widgets.TestWidgets)
Check TextBox line-flow editing works as expected. ... ok
test_list_box (tests.test_widgets.TestWidgets)
Check ListBox widget works as expected. ... ok
test_mouse_input (tests.test_widgets.TestWidgets)
Check mouse input works as expected. ... ok
test_multi_column_list_box (tests.test_widgets.TestWidgets)
Check MultiColumnListBox works as expected. ... ok
test_no_border (tests.test_widgets.TestWidgets)
Check that a Frame with no border works ... ok
test_password (tests.test_widgets.TestWidgets)
Check that we can do password input on Text widgets. ... ok
test_pop_up_widget (tests.test_widgets.TestWidgets)
Check widget tab stops work as expected. ... ok
test_popup_meu (tests.test_widgets.TestWidgets)
Check PopupMenu widget works as expected. ... ok
test_radiobutton_input (tests.test_widgets.TestWidgets)
Check RadioButton input works as expected. ... ok
test_rendering (tests.test_widgets.TestWidgets)
Check Frame renders as expected. ... ok
test_shadow (tests.test_widgets.TestWidgets)
Check Frames support shadows. ... ok
test_stop_frame (tests.test_widgets.TestWidgets)
Check Frames always request no end to the Scene. ... ok
test_text_input (tests.test_widgets.TestWidgets)
Check Text input works as expected. ... ok
test_textbox_input (tests.test_widgets.TestWidgets)
Check TextBox input works as expected. ... ok
test_time_picker (tests.test_widgets.TestWidgets)
Check TimePicker widget works as expected. ... ok
test_title (tests.test_widgets.TestWidgets)
Check Frame titles work as expected. ... ok
test_unicode_rendering (tests.test_widgets.TestWidgets)
Check Frame renders as expected for unicode environments. ... ok
test_validation (tests.test_widgets.TestWidgets)
Check free-form text validation works as expected. ... ok
test_value_defaults (tests.test_widgets.TestWidgets)
Check Widgets can set default values from code. ... ok
test_vertical_divider (tests.test_widgets.TestWidgets)
Check VerticalDivider widget works as expected. ... ok
test_widget_navigation (tests.test_widgets.TestWidgets)
Check widget tab stops work as expected. ... ok

======================================================================
ERROR: test_text_effects (tests.test_effects.TestEffects)
Check effects can be played.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_effects.py", line 48, in test_text_effects
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_colour_image_file (tests.test_renderers.TestRenderers)
Check that the ColourImageFile renderer works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_renderers.py", line 188, in test_colour_image_file
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_rainbow (tests.test_renderers.TestRenderers)
Check that the Rainbow renderer works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_renderers.py", line 301, in test_rainbow
    if sys.platform != "win32" and curses.tigetstr("ri") is None:
_curses.error: must call (at least) setupterm() first

======================================================================
ERROR: test_uni_image_files (tests.test_renderers.TestRenderers)
Check that the unicode ColourImageFile rendering works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_renderers.py", line 257, in test_uni_image_files
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_catch_exceptions (tests.test_screen.TestScreen)
Check that we can catch exceptions (e.g. for ctrl-c).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_centre (tests.test_screen.TestScreen)
Check that centre works as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_cjk_glyphs (tests.test_screen.TestScreen)
Check that CJK languages track double-width glyphs as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_cjk_glyphs_overwrite (tests.test_screen.TestScreen)
Check that CJK languages delete half-glyphs correctly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_ctrl (tests.test_screen.TestScreen)
Check that ctrl returns the right values.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_draw (tests.test_screen.TestScreen)
Check that line drawing works as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_forced_update (tests.test_screen.TestScreen)
Check that forcing an update works as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_highlight (tests.test_screen.TestScreen)
Check that highlight works as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_key_input (tests.test_screen.TestScreen)
Check that keyboard input works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_last_pos (tests.test_screen.TestScreen)
Check that screen drawing is efficient and unaffected by draw.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_limits (tests.test_screen.TestScreen)
Check that get_from and print_at limit checking works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_mouse_input (tests.test_screen.TestScreen)
Check that mouse input works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_next_scene (tests.test_screen.TestScreen)
Check that we can play multiple Scenes.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_open_close (tests.test_screen.TestScreen)
Check Screen.open works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_origin (tests.test_screen.TestScreen)
Check that Canvas origin is correct.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_paint (tests.test_screen.TestScreen)
Check that paint with colour map works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_palette (tests.test_screen.TestScreen)
Check that we have a valid colour palette.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_play (tests.test_screen.TestScreen)
Check that we can play a basic Effect in a Scene.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_polygons (tests.test_screen.TestScreen)
Check that filled polygons work as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_print_and_get (tests.test_screen.TestScreen)
Check that basic print_at and get_from work as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_putch_and_getch (tests.test_screen.TestScreen)
Check deprecated features still work.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_refresh (tests.test_screen.TestScreen)
Check that refresh works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_save_signal_state (tests.test_screen.TestScreen)
Tests that the signal state class works properly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_scroll (tests.test_screen.TestScreen)
Check that scrolling works as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_scroll_redraw (tests.test_screen.TestScreen)
Check that scrolling works with screen locations.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_signal (tests.test_screen.TestScreen)
Check that signals are restored after using _CursesScreen
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_title (tests.test_screen.TestScreen)
Check that we can change the screen title.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_unhandled_events (tests.test_screen.TestScreen)
Check that default handling of events works as documented.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_visible (tests.test_screen.TestScreen)
Check that is_visible works as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_windows_input (tests.test_screen.TestScreen)
Check that extended keyboard input works on Windows.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_wrapper (tests.test_screen.TestScreen)
Check that you can create a blank Screen.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
ERROR: test_wrapper_return (tests.test_screen.TestScreen)
Check that you get the result back from the wrapped function.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_screen.py", line 49, in setUp
    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

======================================================================
FAIL: test_image_files (tests.test_renderers.TestRenderers)
Check that the ImageFile renderer works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_renderers.py", line 178, in test_image_files
    '     ..:::;Gr::s    '])
AssertionError: Lists differ: ['', '     sA3h3h3Hr2     ', '  ;:;G#99G@&2;;;r   ',[187 chars]   '] != ['', '        .:;rA       ', '    :2HG#;H2;s;;2   ',[187 chars]   ']

First differing element 1:
'     sA3h3h3Hr2     '
'        .:;rA       '

Diff is 691 characters long. Set self.maxDiff to None to see it.

----------------------------------------------------------------------
Ran 134 tests in 5.539s

FAILED (failures=1, errors=36)
Test failed: <unittest.runner.TextTestResult run=134 errors=36 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=134 errors=36 failures=1>
builder for '/nix/store/gxqh0j0d458xmr9mc1206crg196z682q-python3.6-asciimatics-1.10.0.drv' failed with exit code 1
error: build of '/nix/store/gxqh0j0d458xmr9mc1206crg196z682q-python3.6-asciimatics-1.10.0.drv' failed

It appears to have something to do with screen tests. Not sure if this is due to Nix build environment or something else.

@worldofpeace
Copy link
Contributor

@CMCDragonkai Edited you comment there to use an expandable markdown thingy, since it can be harder to read the thread.

@CMCDragonkai
Copy link
Member Author

Perhaps there's a missing system dependency needed? Curses or something?

@CMCDragonkai
Copy link
Member Author

@dotlambda
Copy link
Member

Try running these tests in pkgs.bashInteractive.

@CMCDragonkai
Copy link
Member Author

@dotlambda How do I do that?

@dotlambda
Copy link
Member

checkPhase = ''
  ${bashInteractive}/bin/bash -c "nosetests"
'';

I guess

@worldofpeace
Copy link
Contributor

I think even then, wouldn't curses.cbreak just return ERR?

@CMCDragonkai
Copy link
Member Author

CMCDragonkai commented Jan 23, 2019

From the response of asciimatics, some of the tests are expected to fail due to them being pinned to an older Pillow version.

peterbrittain/asciimatics#199 (comment)

@CMCDragonkai
Copy link
Member Author

Using bashInteractive results in the same set of errors.

@CMCDragonkai
Copy link
Member Author

CMCDragonkai commented Jan 23, 2019

Ok so there are 36 errors due to:

    curses.initscr()
  File "/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
ValueError: underlying buffer has been detached

1 error due to:

_curses.error: must call (at least) setupterm() first

There's 1 FAIL:

FAIL: test_image_files (tests.test_renderers.TestRenderers)
Check that the ImageFile renderer works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/asciimatics-1.10.0/tests/test_renderers.py", line 178, in test_image_files
    '     ..:::;Gr::s    '])
AssertionError: Lists differ: ['', '     sA3h3h3Hr2     ', '  ;:;G#99G@&2;;;r   ',[187 chars]   '] != ['', '        .:;rA       ', '    :2HG#;H2;s;;2   ',[187 chars]   ']

First differing element 1:
'     sA3h3h3Hr2     '
'        .:;rA       '

Diff is 691 characters long. Set self.maxDiff to None to see it.

It might be that the last 1 FAIL is actually expected to fail due to incompatible Pillow version. While the 36 errors are due to some weird STDOUT issue.

The curses.initscr() is a standard function from the curses module in Python standard library.

When running on NixOS or nix-shell it just works without errors. However it appears when running the test here it fails. Here's one of the test failure locations: https://github.com/peterbrittain/asciimatics/blob/master/tests/test_effects.py#L48

Is there a way to step into a nix-build here, and simulate the same build environment and run that command? I have a feeling that this is because nix-build has a "non-standard terminal environment".

@CMCDragonkai
Copy link
Member Author

CMCDragonkai commented Jan 23, 2019

I have discovered that running the tests without redirecting the STDOUT results in the tests succeeding in many of those failures. Of course there's still some other errors, but as we saw above, that could be due to Pillow.

Whereas if you redirect the STDOUT of the tests to somewhere else, then the tests fail like before.

The result of running the tests without redirecting STDOUT is:

======================================================================
ERROR: test_polygons (tests.test_screen.TestScreen)
Check that filled polygons work as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/tests/test_screen.py", line 343, in test_polygons
    arguments=[internal_checks])
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/asciimatics/screen.py", line 1168, in wrapper
    return func(screen, *arguments)
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/tests/test_screen.py", line 40, in check_screen_and_canvas
    fn(test_object)
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/tests/test_screen.py", line 337, in internal_checks
    ".########.          7        Y          ##########          ##########     \n")
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/tests/test_screen.py", line 64, in assert_canvas_equals
    raise RuntimeError("{} {}".format(x, y))
RuntimeError: 66 0
-------------------- >> begin captured logging << --------------------
asciimatics.screen: DEBUG: Processing polygon: [[(0, 0), (10, 0), (0, 10), (10, 10)]]
asciimatics.screen: DEBUG: Resulting edges: [{'min_y': 0, 'max_y': 10, 'x': 0, 'dx': 0.5}, {'min_y': 0, 'max_y': 10, 'x': 10, 'dx': -0.5}]
asciimatics.screen: DEBUG: Processing polygon: [[(20, 0), (30, 0), (30, 10), (25, 5), (20, 10)]]
asciimatics.screen: DEBUG: Resulting edges: [{'min_y': 0, 'max_y': 10, 'x': 20, 'dx': 0.0}, {'min_y': 5, 'max_y': 10, 'x': 25, 'dx': 0.5}, {'min_y': 5, 'max_y': 10, 'x': 25, 'dx': -0.5}, {'min_y': 0, 'max_y': 10, 'x': 30, 'dx': 0.0}]
asciimatics.screen: DEBUG: Processing polygon: [[(40, 0), (45, 5), (50, 0), (50, 10), (40, 10)]]
asciimatics.screen: DEBUG: Resulting edges: [{'min_y': 0, 'max_y': 5, 'x': 40, 'dx': 0.5}, {'min_y': 0, 'max_y': 10, 'x': 40, 'dx': 0.0}, {'min_y': 0, 'max_y': 5, 'x': 50, 'dx': -0.5}, {'min_y': 0, 'max_y': 10, 'x': 50, 'dx': 0.0}]
asciimatics.screen: DEBUG: Processing polygon: [[(60, 0), (70, 0), (70, 10), (60, 10)], [(63, 2), (67, 2), (67, 8), (63, 8)]]
asciimatics.screen: DEBUG: Resulting edges: [{'min_y': 0, 'max_y': 10, 'x': 60, 'dx': 0.0}, {'min_y': 2, 'max_y': 8, 'x': 63, 'dx': 0.0}, {'min_y': 2, 'max_y': 8, 'x': 67, 'dx': 0.0}, {'min_y': 0, 'max_y': 10, 'x': 70, 'dx': 0.0}]
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test_colour_image_file (tests.test_renderers.TestRenderers)
Check that the ColourImageFile renderer works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/tests/test_renderers.py", line 247, in test_colour_image_file
    Screen.wrapper(internal_checks, height=15)
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/asciimatics/screen.py", line 1170, in wrapper
    return func(screen)
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/tests/test_renderers.py", line 221, in internal_checks
    '     ###########    '])
AssertionError: Lists differ: ['', '     ##########     ', '  ###############   ',[187 chars]   '] != ['', '        #####       ', '    #############   ',[187 chars]   ']

First differing element 1:
'     ##########     '
'        #####       '

Diff is 736 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_image_files (tests.test_renderers.TestRenderers)
Check that the ImageFile renderer works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/tests/test_renderers.py", line 178, in test_image_files
    '     ..:::;Gr::s    '])
AssertionError: Lists differ: ['', '     sA3h3h3Hr2     ', '  ;:;G#99G@&2;;;r   ',[187 chars]   '] != ['', '        .:;rA       ', '    :2HG#;H2;s;;2   ',[187 chars]   ']

First differing element 1:
'     sA3h3h3Hr2     '
'        .:;rA       '

Diff is 691 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_uni_image_files (tests.test_renderers.TestRenderers)
Check that the unicode ColourImageFile rendering works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/tests/test_renderers.py", line 292, in test_uni_image_files
    Screen.wrapper(internal_checks, height=15)
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/asciimatics/screen.py", line 1170, in wrapper
    return func(screen)
  File "/tmp/nix-build-python3.6-asciimatics-1.10.0.drv-0/asciimatics-1.10.0/tests/test_renderers.py", line 290, in internal_checks
    '.....▄▄▄▄▄▄▄▄▄▄▄.....'])
AssertionError: Lists differ: ['.', '....▄▄▄▄▄▄▄▄▄▄▄▄.....', '..▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄..[198 chars]...'] != ['.', '.....▄▄▄▄▄▄▄▄▄▄......', '...▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄..[198 chars]...']

First differing element 1:
'....▄▄▄▄▄▄▄▄▄▄▄▄.....'
'.....▄▄▄▄▄▄▄▄▄▄......'

  ['.',
-  '....▄▄▄▄▄▄▄▄▄▄▄▄.....',
?       ^^

+  '.....▄▄▄▄▄▄▄▄▄▄......',
?       ^               +

-  '..▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄...',
?     ^

+  '...▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄...',
?     ^

   '.▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄..',
+  '.▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄.',
   '▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄.',
   '▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄.',
-  '▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄.',
?   ^

+  '.▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄.',
?   ^

-  '▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄..',
   '.▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄..',
-  '..▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄....',
?                       -

+  '...▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄...',
?   +

-  '.....▄▄▄▄▄▄▄▄▄▄......']
?                  ^

+  '.....▄▄▄▄▄▄▄▄▄▄▄.....']
?                  ^


----------------------------------------------------------------------
Ran 134 tests in 9.391s

FAILED (failures=3, errors=1, skipped=1)
Test failed: <unittest.runner.TextTestResult run=134 errors=1 failures=3>
error: Test failed: <unittest.runner.TextTestResult run=134 errors=1 failures=3>

I did this by using nix-build -K. Sourcing the env-vars. Entering into asciimatics-1.10.0. Then running:

/nix/store/pz585g2lrcy87sbligvfr0cwa8c8c88k-python3-3.6.8/bin/python3.6 nix_run_setup test

This I think shows that these tests require a non-redirected STDOUT. As in a real tty to be used when running those tests as it is performing tests on the terminal using curses.

@CMCDragonkai
Copy link
Member Author

CMCDragonkai commented Jan 23, 2019

We need a pty allocator/terminal emulator to run the asciimatics tests in an unattended manner. I want to try using expect first, but I'm not sure if it will work properly when it comes to curses test. @cleverca22 suggested libtsm as it actually simulates a full terminal, but hardly any documentation.

@dotlambda
Copy link
Member

There's no point in investing so much time in enabling the tests. We can still test functionality by hand.

@CMCDragonkai
Copy link
Member Author

CMCDragonkai commented Jan 23, 2019

Alright. My research showed that using expect does work to some extent, but you need to setup the terminal information to be a proper emulator. See: https://github.com/dineshkummarc/expect-src/blob/master/example/term_expect for an example. However that will complicate this test setup significantly.

  checkPhase = ''
    ${expect}/bin/expect -c '
      spawn nosetests
      interact
      catch wait status
      exit [lindex $status 3]
    '
  '';

The above could work if all terminal info was setup, but without it, it results in an non-terminating error where it blocks on: curses.error: setupterm: could not find terminal.

Alternatively if someone knows how to use libtsm that could also be an option. Looks like there hasn't always been much work on test harnesses for TUI applications.

I'll just disable tests for now and hope that dvc can make use of it.

@CMCDragonkai
Copy link
Member Author

Done.

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran tests locally but they obviously will still fail because of the issues with pillow.
Though I think it should be fine.

Thanks a lot for your investigation on trying to run tests that need a pty emulator.
Your suggested setup could still be useful elsewhere in nixpkgs, and I will use this as a reference if the need arise.

@worldofpeace worldofpeace dismissed FRidh’s stale review January 23, 2019 06:19

Resolved by author

@dotlambda
Copy link
Member

@GrahamcOfBorg build python2.pkgs.asciimatics python3.pkgs.asciimatics

@dotlambda dotlambda merged commit 8c645b4 into NixOS:master Jan 23, 2019
@CMCDragonkai CMCDragonkai mentioned this pull request Aug 5, 2019
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants