{"action":"created","issue":{"url":"https://api.github.com/repos/psychopy/psychopy/issues/1794","repository_url":"https://api.github.com/repos/psychopy/psychopy","labels_url":"https://api.github.com/repos/psychopy/psychopy/issues/1794/labels{/name}","comments_url":"https://api.github.com/repos/psychopy/psychopy/issues/1794/comments","events_url":"https://api.github.com/repos/psychopy/psychopy/issues/1794/events","html_url":"https://github.com/psychopy/psychopy/issues/1794","id":311846428,"number":1794,"title":"wishlist: to not require \"sounddevice\" module if running tests not requiring sound","user":{"login":"yarikoptic","id":39889,"avatar_url":"https://avatars3.githubusercontent.com/u/39889?v=4","gravatar_id":"","url":"https://api.github.com/users/yarikoptic","html_url":"https://github.com/yarikoptic","followers_url":"https://api.github.com/users/yarikoptic/followers","following_url":"https://api.github.com/users/yarikoptic/following{/other_user}","gists_url":"https://api.github.com/users/yarikoptic/gists{/gist_id}","starred_url":"https://api.github.com/users/yarikoptic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarikoptic/subscriptions","organizations_url":"https://api.github.com/users/yarikoptic/orgs","repos_url":"https://api.github.com/users/yarikoptic/repos","events_url":"https://api.github.com/users/yarikoptic/events{/privacy}","received_events_url":"https://api.github.com/users/yarikoptic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-06T04:43:10Z","updated_at":"2018-04-06T11:05:40Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"ATM would just end up refusing to run any tests since I guess too many errors during tests collection, if \"sounddevice\" module is not available:\r\n\r\n```\r\nI: Running tests using default Python\r\ncd build \\\r\n\t&& USER=nobody TRAVIS=true \\\r\n\txvfb-run -s \"-screen 0 1024x768x24 -ac +extension GLX +render -noreset\" python -m pytest --tb=line -s -v -m \"not needs_sound\" ../psychopy || { echo \"TESTS FAILED\"; :; }\r\n12:39:19 AM: Debug: Failed to connect to session manager: None of the authentication protocols specified are supported\r\n====================================================================================================== test session starts =======================================================================================================\r\nplatform linux2 -- Python 2.7.14+, pytest-3.3.2, py-1.5.2, pluggy-0.6.0 -- /usr/bin/python\r\ncachedir: ../.cache\r\nrootdir: /home/yoh/deb/gits/pkg-exppsy/psychopy, inifile: pytest.ini\r\nplugins: xdist-1.22.2, localserver-0.3.7, forked-0.2, cov-2.5.1, hypothesis-3.44.1, celery-4.1.0\r\ncollecting 537 items                                                                                                                                                                                                             We need to run some tests on your graphics card (hopefully just once).\r\nThe BitsSharp will go into status mode while this is done.\r\nIt can take a minute or two...\r\ncollected 610 items / 6 errors                                                                                                                                                                                                   \r\n\r\n============================================================================================================= ERRORS =============================================================================================================\r\n_________________________________________________________________________________ ERROR collecting psychopy/tests/test_hardware/test_emulator.py _________________________________________________________________________________\r\nImportError while importing test module '/home/yoh/deb/gits/pkg-exppsy/psychopy/psychopy/tests/test_hardware/test_emulator.py'.\r\nHint: make sure your test modules/packages have valid Python names.\r\nTraceback:\r\n../psychopy/tests/test_hardware/test_emulator.py:12: in <module>\r\n    from psychopy.hardware import emulator\r\n../psychopy/hardware/emulator.py:20: in <module>\r\n    from psychopy.sound import Sound  # for SyncGenerator tone\r\n../psychopy/sound/__init__.py:79: in <module>\r\n    from . import backend_sounddevice as backend\r\n../psychopy/sound/backend_sounddevice.py:19: in <module>\r\n    import sounddevice as sd\r\nE   ImportError: No module named sounddevice\r\n__________________________________________________________________________________ ERROR collecting psychopy/tests/test_misc/test_microphone.py __________________________________________________________________________________\r\nImportError while importing test module '/home/yoh/deb/gits/pkg-exppsy/psychopy/psychopy/tests/test_misc/test_microphone.py'.\r\nHint: make sure your test modules/packages have valid Python names.\r\nTraceback:\r\n../psychopy/tests/test_misc/test_microphone.py:5: in <module>\r\n    from psychopy import microphone, core, web\r\n../psychopy/microphone.py:43: in <module>\r\n    from psychopy import core, logging, sound, web, prefs\r\n../psychopy/sound/__init__.py:79: in <module>\r\n    from . import backend_sounddevice as backend\r\n../psychopy/sound/backend_sounddevice.py:19: in <module>\r\n    import sounddevice as sd\r\nE   ImportError: No module named sounddevice\r\n___________________________________________________________________________________ ERROR collecting psychopy/tests/test_sound/test_hamming.py ___________________________________________________________________________________\r\nImportError while importing test module '/home/yoh/deb/gits/pkg-exppsy/psychopy/psychopy/tests/test_sound/test_hamming.py'.\r\nHint: make sure your test modules/packages have valid Python names.\r\nTraceback:\r\n../psychopy/tests/test_sound/test_hamming.py:2: in <module>\r\n    from psychopy.sound._base import apodize, HammingWindow\r\n../psychopy/sound/__init__.py:79: in <module>\r\n    from . import backend_sounddevice as backend\r\n../psychopy/sound/backend_sounddevice.py:19: in <module>\r\n    import sounddevice as sd\r\nE   ImportError: No module named sounddevice\r\n________________________________________________________________________________ ERROR collecting psychopy/tests/test_sound/test_sound_pygame.py _________________________________________________________________________________\r\nImportError while importing test module '/home/yoh/deb/gits/pkg-exppsy/psychopy/psychopy/tests/test_sound/test_sound_pygame.py'.\r\nHint: make sure your test modules/packages have valid Python names.\r\nTraceback:\r\n../psychopy/tests/test_sound/test_sound_pygame.py:14: in <module>\r\n    from psychopy import sound #, microphone\r\n../psychopy/sound/__init__.py:79: in <module>\r\n    from . import backend_sounddevice as backend\r\n../psychopy/sound/backend_sounddevice.py:19: in <module>\r\n    import sounddevice as sd\r\nE   ImportError: No module named sounddevice\r\n__________________________________________________________________________________ ERROR collecting psychopy/tests/test_sound/test_sound_pyo.py __________________________________________________________________________________\r\nImportError while importing test module '/home/yoh/deb/gits/pkg-exppsy/psychopy/psychopy/tests/test_sound/test_sound_pyo.py'.\r\nHint: make sure your test modules/packages have valid Python names.\r\nTraceback:\r\n../psychopy/tests/test_sound/test_sound_pyo.py:15: in <module>\r\n    from psychopy import sound, microphone\r\n../psychopy/sound/__init__.py:79: in <module>\r\n    from . import backend_sounddevice as backend\r\n../psychopy/sound/backend_sounddevice.py:19: in <module>\r\n    import sounddevice as sd\r\nE   ImportError: No module named sounddevice\r\n______________________________________________________________________________ ERROR collecting psychopy/tests/test_sound/test_sound_sounddevice.py ______________________________________________________________________________\r\nImportError while importing test module '/home/yoh/deb/gits/pkg-exppsy/psychopy/psychopy/tests/test_sound/test_sound_sounddevice.py'.\r\nHint: make sure your test modules/packages have valid Python names.\r\nTraceback:\r\n../psychopy/tests/test_sound/test_sound_sounddevice.py:15: in <module>\r\n    from psychopy import sound\r\n../psychopy/sound/__init__.py:79: in <module>\r\n    from . import backend_sounddevice as backend\r\n../psychopy/sound/backend_sounddevice.py:19: in <module>\r\n    import sounddevice as sd\r\nE   ImportError: No module named sounddevice\r\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 6 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n==================================================================================================== 6 error in 9.99 seconds =====================================================================================================\r\n3.9200 \tWARNING \tMonitor specification not found. Creating a temporary one...\r\n4.7962 \tWARNING \tIt looks like we're running in the Travis-CI testing environment. Hardware gamma table cannot be retrieved\r\n10.6647 \tWARNING \tMonitor specification not found. Creating a temporary one...\r\n10.6649 \tWARNING \tRequested an unavailable screen number - using first available.\r\n10.8027 \tWARNING \tIt looks like we're running in the Travis-CI testing environment. Hardware gamma table cannot be retrieved\r\n11.1010 \tEXP \tCreated window1 = Window(allowGUI=True, allowStencil=False, args=UNKNOWN, autoLog=True, bitsMode=UNKNOWN, blendMode='avg', color=array([ 0.,  0.,  0.]), colorSpace='rgb', fullscr=UNKNOWN, gamma=None, kwargs=UNKNOWN, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x7f3742fd6890>, multiSample=False, name='window1', numSamples=2, pos=[0, 0], screen=1, size=array([1024,  768]), stereo=False, units=u'norm', useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType=u'pyglet')\r\n11.1012 \tINFO \tSwitched Bits# to bits++ mode\r\n11.1040 \tWARNING \tno config file yet for <psychopy.hardware.crs.bits.BitsSharp object at 0x7f3743471dd0>\r\n11.1040 \tWARNING \tThe graphics card or its driver has changed. We'll re-check the identity LUT for the card\r\n11.2540 \tEXP \tCreated unnamed TextStim = TextStim(alignHoriz='center', alignVert='center', antialias=True, autoLog=True, bold=False, color=array([ 1.,  1.,  1.]), colorSpace='rgb', contrast=1.0, depth=0, flipHoriz=False, flipVert=False, font='', fontFiles=[], height=0.1, italic=False, name='unnamed TextStim', opacity=1.0, ori=0.0, pos=array([ 0.,  0.]), rgb=array([ 1.,  1.,  1.]), text=newstr(...), units=u'norm', win=Window(...), wrapWidth=1)\r\n12.3585 \tEXP \tCreated unnamed ImageStim = ImageStim(autoLog=True, color=array([ 1.,  1.,  1.]), colorSpace='rgb', contrast=1.0, depth=0, flipHoriz=False, flipVert=False, image=ndarray(...), interpolate=False, mask=None, maskParams=None, name='unnamed ImageStim', opacity=1.0, ori=0.0, pos=array([-384.,    0.]), size=array([ 256.,  768.]), texRes=128, units='pix', win=Window(...))\r\n12.4402 \tEXP \tCreated unnamed ImageStim = ImageStim(autoLog=True, color=array([ 1.,  1.,  1.]), colorSpace='rgb', contrast=1.0, depth=0, flipHoriz=False, flipVert=False, image=ndarray(...), interpolate=False, mask=None, maskParams=None, name='unnamed ImageStim', opacity=1.0, ori=0.0, pos=array([-384.,    0.]), size=array([ 256.,  768.]), texRes=128, units='pix', win=Window(...))\r\n12.4427 \tEXP \tCreated unnamed GratingStim = GratingStim(autoDraw=False, autoLog=True, blendmode='avg', color=array([ 1.,  1.,  1.]), colorSpace='rgb', contrast=0.5, depth=0, interpolate=False, mask='gauss', maskParams=None, name='unnamed GratingStim', opacity=1.0, ori=45.0, phase=array([ 0.,  0.]), pos=array([ 0.,  0.]), rgbPedestal=array([ 0.,  0.,  0.]), sf=array([ 3.,  3.]), size=array([ 0.5,  0.5]), tex='sin', texRes=128, units=u'norm', win=Window(...))\r\n13.5841 \tDEBUG \tPsychoPyApp: Quitting...\r\n13.5942 \tEXP \twindow1: mouseVisible = True\r\nException TypeError: \"'NoneType' object is not callable\" in <bound method ImageStim.__del__ of <psychopy.visual.image.ImageStim object at 0x7f3743471f50>> ignored\r\n```\r\n\r\nexpected -- to just skip the tests requiring sound (And thus sounddevice module)"},"comment":{"url":"https://api.github.com/repos/psychopy/psychopy/issues/comments/379221444","html_url":"https://github.com/psychopy/psychopy/issues/1794#issuecomment-379221444","issue_url":"https://api.github.com/repos/psychopy/psychopy/issues/1794","id":379221444,"user":{"login":"peircej","id":380582,"avatar_url":"https://avatars2.githubusercontent.com/u/380582?v=4","gravatar_id":"","url":"https://api.github.com/users/peircej","html_url":"https://github.com/peircej","followers_url":"https://api.github.com/users/peircej/followers","following_url":"https://api.github.com/users/peircej/following{/other_user}","gists_url":"https://api.github.com/users/peircej/gists{/gist_id}","starred_url":"https://api.github.com/users/peircej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peircej/subscriptions","organizations_url":"https://api.github.com/users/peircej/orgs","repos_url":"https://api.github.com/users/peircej/repos","events_url":"https://api.github.com/users/peircej/events{/privacy}","received_events_url":"https://api.github.com/users/peircej/received_events","type":"User","site_admin":false},"created_at":"2018-04-06T11:05:39Z","updated_at":"2018-04-06T11:05:39Z","author_association":"OWNER","body":"Unlike pyo, with sounddevice we were able to flush more of the test code and skip only the code where the actual sound is played. I kinda like that. It means that Travis is testing more of the sound code. \r\nAt the moment the test for that is based on `os.environ(\"TRAVIS\")==True` but we could make that based on the no sound flag instead. https://github.com/psychopy/psychopy/blob/fbac42361b3e2365b7590ebff10c7a6d503dc79d/psychopy/sound/backend_sounddevice.py#L152\r\n\r\nSo could you just install sounddevice, even though no actual sound is going to be played? The errors will go away but still no sound will occur and we'll test as much of the sound engine as possible"}}
{"actor":{"display_login":"peircej"}}