Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Should the tests skip if $DISPLAY is not set up #91

Description

@DougBurke

Running python setup.py test -a -v on a remote macOS system which doesn't have X forwarding set up causes the tests to hang when it gets to the "can you start ds9 and communicate with it" tests. I assume this is what caused some of the recent test "failures" when they would time out (as they seemed to be timing out at this point).

If I control-c I get info (from tcl/tk?) that the display is borked - e.g.

pyds9/tests/test_pyds9.py::test_ds9_targets_empty PASSED                 [ 41%]
pyds9/tests/test_pyds9.py::test_ds9_targets ^Capplication-specific initialization failed: no display name and no $DISPLAY environment variable
application-specific initialization failed: no display name and no $DISPLAY environment variable
Unable to initialize window system.
Unable to initialize window system.
application-specific initialization failed: no display name and no $DISPLAY environment variable
Unable to initialize window system.

Something like the (untested)

import os

display_not_set = 'DISPLAY' not in os.environ

@pytest.mark.skipif(display_not_set, reason='No DISPLAY environment variable!')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions