{"action":"closed","issue":{"url":"https://api.github.com/repos/erikrose/blessings/issues/117","labels_url":"https://api.github.com/repos/erikrose/blessings/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/erikrose/blessings/issues/117/comments","events_url":"https://api.github.com/repos/erikrose/blessings/issues/117/events","html_url":"https://github.com/erikrose/blessings/issues/117","id":129921134,"number":117,"title":"Tests fail in non-interactive terminals","user":{"login":"sbraz","id":4833332,"avatar_url":"https://avatars.githubusercontent.com/u/4833332?v=3","gravatar_id":"","url":"https://api.github.com/users/sbraz","html_url":"https://github.com/sbraz","followers_url":"https://api.github.com/users/sbraz/followers","following_url":"https://api.github.com/users/sbraz/following{/other_user}","gists_url":"https://api.github.com/users/sbraz/gists{/gist_id}","starred_url":"https://api.github.com/users/sbraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbraz/subscriptions","organizations_url":"https://api.github.com/users/sbraz/orgs","repos_url":"https://api.github.com/users/sbraz/repos","events_url":"https://api.github.com/users/sbraz/events{/privacy}","received_events_url":"https://api.github.com/users/sbraz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-30T00:49:21Z","updated_at":"2016-01-30T12:03:21Z","closed_at":"2016-01-30T12:03:21Z","body":"Hi,\r\nsome tests currently fail when ran in a non-interactive terminal which makes automated testing difficult.\r\nI'm not sure this is expected since most of your tests use a fake `Terminal` on purpose, so I'm assuming the ones that don't should work even in a non-interactive term.\r\n\r\nCan you fix it or is this something we should work around?\r\n\r\nHere is the error:\r\n```\r\nrunning test\r\nrunning egg_info\r\nwriting blessings.egg-info/PKG-INFO\r\nwriting top-level names to blessings.egg-info/top_level.txt\r\nwriting dependency_links to blessings.egg-info/dependency_links.txt\r\nreading manifest file 'blessings.egg-info/SOURCES.txt'\r\nreading manifest template 'MANIFEST.in'\r\nwriting manifest file 'blessings.egg-info/SOURCES.txt'\r\nrunning build_ext\r\nblessings.tests.test_capability\r\nCheck that a capability lookup works. ... ERROR\r\nblessings.tests.test_capability_without_tty\r\nAssert capability templates are '' when stream is not a tty. ... ok\r\nblessings.tests.test_capability_with_forced_tty\r\nIf we force styling, capabilities had better not (generally) be ... ok\r\nblessings.tests.test_parametrization\r\nTest parametrizing a capability. ... FAIL\r\nblessings.tests.test_height_and_width\r\nAssert that ``height_and_width()`` returns ints. ... FAIL\r\nblessings.tests.test_stream_attr\r\nMake sure Terminal exposes a ``stream`` attribute that defaults to ... ok\r\nblessings.tests.test_location\r\nMake sure ``location()`` does what it claims. ... ok\r\nblessings.tests.test_horizontal_location\r\nMake sure we can move the cursor horizontally without changing rows. ... ok\r\nblessings.tests.test_null_location\r\nMake sure ``location()`` with no args just does position restoration. ... ok\r\nblessings.tests.test_zero_location\r\nMake sure ``location()`` pays attention to 0-valued args. ... ok\r\nblessings.tests.test_null_fileno\r\nMake sure ``Terminal`` works when ``fileno`` is ``None``. ... ok\r\nblessings.tests.test_mnemonic_colors\r\nMake sure color shortcuts work. ... FAIL\r\nblessings.tests.test_callable_numeric_colors\r\n``color(n)`` should return a formatting wrapper. ... ok\r\nblessings.tests.test_null_callable_numeric_colors\r\n``color(n)`` should be a no-op on null terminals. ... ok\r\nblessings.tests.test_naked_color_cap\r\n``term.color`` should return a stringlike capability. ... ok\r\nblessings.tests.test_number_of_colors_without_tty\r\n``number_of_colors`` should return 0 when there's no tty. ... SKIP\r\nblessings.tests.test_number_of_colors_with_tty\r\n``number_of_colors`` should work. ... ok\r\nblessings.tests.test_formatting_functions\r\nTest crazy-ass formatting wrappers, both simple and compound. ... ok\r\nblessings.tests.test_formatting_functions_without_tty\r\nTest crazy-ass formatting wrappers when there's no tty. ... ok\r\nblessings.tests.test_nice_formatting_errors\r\nMake sure you get nice hints if you misspell a formatting wrapper. ... ok\r\nblessings.tests.test_init_descriptor_always_initted\r\nWe should be able to get a height and width even on no-tty Terminals. ... FAIL\r\nblessings.tests.test_force_styling_none\r\nIf ``force_styling=None`` is passed to the constructor, don't ever do ... ok\r\nblessings.tests.test_null_callable_string\r\nMake sure NullCallableString tolerates all numbers and kinds of args it ... ok\r\n\r\n======================================================================\r\nERROR: blessings.tests.test_capability\r\nCheck that a capability lookup works.\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/usr/lib64/python2.7/site-packages/nose/case.py\", line 197, in runTest\r\n    self.test(*self.arg)\r\n  File \"/home/jo/compil/blessings-1.6/blessings/tests.py\", line 47, in test_capability\r\n    sc = unicode_cap('sc')\r\n  File \"/home/jo/compil/blessings-1.6/blessings/tests.py\", line 31, in unicode_cap\r\n    return tigetstr(cap).decode('latin1')\r\nerror: must call (at least) setupterm() first\r\n\r\n======================================================================\r\nFAIL: blessings.tests.test_parametrization\r\nTest parametrizing a capability.\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/usr/lib64/python2.7/site-packages/nose/case.py\", line 197, in runTest\r\n    self.test(*self.arg)\r\n  File \"/home/jo/compil/blessings-1.6/blessings/tests.py\", line 68, in test_parametrization\r\n    eq_(TestTerminal().cup(3, 4), unicode_parm('cup', 3, 4))\r\nAssertionError: u'' != u'\\x1b[4;5H'\r\n\r\n======================================================================\r\nFAIL: blessings.tests.test_height_and_width\r\nAssert that ``height_and_width()`` returns ints.\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/usr/lib64/python2.7/site-packages/nose/case.py\", line 197, in runTest\r\n    self.test(*self.arg)\r\n  File \"/home/jo/compil/blessings-1.6/blessings/tests.py\", line 74, in test_height_and_width\r\n    assert isinstance(t.height, int)\r\nAssertionError\r\n\r\n======================================================================\r\nFAIL: blessings.tests.test_mnemonic_colors\r\nMake sure color shortcuts work.\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/usr/lib64/python2.7/site-packages/nose/case.py\", line 197, in runTest\r\n    self.test(*self.arg)\r\n  File \"/home/jo/compil/blessings-1.6/blessings/tests.py\", line 149, in test_mnemonic_colors\r\n    eq_(t.white, color(7))\r\nAssertionError: u'' != u'\\x1b[37m'\r\n\r\n======================================================================\r\nFAIL: blessings.tests.test_init_descriptor_always_initted\r\nWe should be able to get a height and width even on no-tty Terminals.\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/usr/lib64/python2.7/site-packages/nose/case.py\", line 197, in runTest\r\n    self.test(*self.arg)\r\n  File \"/home/jo/compil/blessings-1.6/blessings/tests.py\", line 254, in test_init_descriptor_always_initted\r\n    eq_(type(t.height), int)\r\nAssertionError: <type 'NoneType'> != <type 'int'>\r\n\r\n----------------------------------------------------------------------\r\nRan 23 tests in 0.009s\r\n\r\nFAILED (failures=4, errors=1, skipped=1)\r\n\r\n```"}}