pytest-services icon indicating copy to clipboard operation
pytest-services copied to clipboard

memcached assumes Unix sockets

Open jaraco opened this issue 7 years ago • 4 comments

Today I wanted to use the memcached service fixture in the CherryPy project, but because the fixture here doesn't support Windows, I had chose instead to write our own. Perhaps this project would consider using TCP ports for the memcached service for Windows compatibility.

jaraco avatar Sep 09 '18 14:09 jaraco

Another issue with Windows is that this dist unconditionally imports fcntl, which crashes tests during setup time, when pytest looks up for and tries to import fixtures: https://ci.appveyor.com/project/CherryPy/cherrypy/build/1.0.444/job/seei217vtwplqk6h#L500

webknjaz avatar Sep 09 '18 23:09 webknjaz

(created #23 for that)

webknjaz avatar Sep 09 '18 23:09 webknjaz

The services_log fixture also assumes Unix sockets:

___________ ERROR at setup of test_devpi_upload[twine-1.5.0.tar.gz] ___________

slave_id = 'local'

    @pytest.fixture(scope='session')
    def services_log(slave_id):
        """A services_logger with the slave id."""
        handler = None
        for kwargs in (dict(socktype=socket.SOCK_RAW), dict(socktype=socket.SOCK_STREAM), dict()):
            try:
>               handler = logging.handlers.SysLogHandler(
                    facility=logging.handlers.SysLogHandler.LOG_LOCAL7, address='/dev/log', **kwargs)

.tox\py\lib\site-packages\pytest_services\log.py:16: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\hostedtoolcache\windows\Python\3.8.3\x64\lib\logging\handlers.py:821: in __init__
    self._connect_unixsocket(address)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <SysLogHandler (NOTSET)>, address = '/dev/log'

    def _connect_unixsocket(self, address):
        use_socktype = self.socktype
        if use_socktype is None:
            use_socktype = socket.SOCK_DGRAM
>       self.socket = socket.socket(socket.AF_UNIX, use_socktype)
E       AttributeError: module 'socket' has no attribute 'AF_UNIX'

C:\hostedtoolcache\windows\Python\3.8.3\x64\lib\logging\handlers.py:853: AttributeError

di avatar Jun 04 '20 13:06 di

@di please submit a PR addressing it

bubenkoff avatar Jun 05 '20 00:06 bubenkoff