Skip to content

Conversation

@heroesm
Copy link

@heroesm heroesm commented Sep 21, 2020

use case:

>>> import remote_pdb as rpdb
>>> rpdb.set_trace('./t.sock')
>>> rpdb.set_trace('t.sock', unixsocket=True)
>>> rpdb.set_trace(unixsocket='t.sock')

invalid:

>>> import remote_pdb as rpdb
>>> rpdb.set_trace('t.sock')
socket.gaierror: [Errno -2] Name or service not known

@ionelmc
Copy link
Owner

ionelmc commented Sep 21, 2020

Hey, thanks for taking #20 over. I wonder if we could avoid set_trace(None, unixsocket='t.sock') and allow set_trace(unixsocket='t.sock') (have host='127.0.0.1' as default).

@heroesm
Copy link
Author

heroesm commented Sep 21, 2020

@ionelmc fixed

@heroesm
Copy link
Author

heroesm commented Sep 26, 2020

Any feedback?

@ionelmc
Copy link
Owner

ionelmc commented Sep 26, 2020

Looks good. Would you be so kind to also take a look at the tests?

@heroesm
Copy link
Author

heroesm commented Oct 8, 2020

@ionelmc
I've tried, but the test tool process_tests is not familiar to me.

I cannot even pass the simple test case in my local environment, even in the master branch:

$ pytest tests/test_remote_pdb.py::test_simple
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.8.0, pytest-6.1.1, py-1.9.0, pluggy-0.13.1
rootdir: /home/m/git/python-remote-pdb, configfile: setup.cfg
plugins: travis-fold-1.3.0
collected 1 item                                                                                                                                                                             

tests/test_remote_pdb.py F                                                                                                                                                             [100%]

========================================================================================== FAILURES ==========================================================================================
________________________________________________________________________________________ test_simple _________________________________________________________________________________________
tests/test_remote_pdb.py:25: in test_simple
    wait_for_strings(proc.read, TIMEOUT,
../../.pyenv/versions/3.8.0/envs/py38env/lib/python3.8/site-packages/process_tests.py:246: in wait_for_strings
    raise AssertionError("Waited %0.2fsecs but %s did not appear in output in the given order !" % (
E   AssertionError: Waited 10.00secs but ['RemotePdb session open at ', '{b1}', '{a1}'] did not appear in output in the given order !
------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------
*********** OUTPUT ***********
413062 10/09/20~03:34:22,00867 remote_pdb CRITICAL RemotePdb session open at 127.0.0.1:42597, waiting for connection ...
RemotePdb session open at 127.0.0.1:42597, waiting for connection ...

******************************
================================================================================== short test summary info ===================================================================================
FAILED tests/test_remote_pdb.py::test_simple - AssertionError: Waited 10.00secs but ['RemotePdb session open at ', '{b1}', '{a1}'] did not appear in output in the given order !
===================================================================================== 1 failed in 11.33s =====================================================================================

BTW, should process_tests and other test requirements be declared in setup.py?

@ionelmc
Copy link
Owner

ionelmc commented Nov 2, 2020

Tests are to be run with tox. Not sure what's going on in your example there, perhaps push the test you have?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants