Skip to content

tmux cant find sessions when testing in docker #265

Description

@FergusFettes

Steps to reproduce:
test_tmux.py

import libtmux
import pytest


@pytest.fixture
def server():
    server = libtmux.Server()
    return server


def test_can_start_tmux_session(server):
    server.new_session("test")
    assert server.has_session("test")
    server.kill_session("test")

Dockerfile:

FROM ubuntu:18.04

RUN apt-get update && apt install -y tmux python-pip
RUN pip install libtmux pytest

COPY test_tmux.py .
RUN pytest test_tmux.py

then docker build . fails with

        if 'session_id' not in kwargs:
>           raise ValueError('Session requires a `session_id`')
E           ValueError: Session requires a `session_id`

Interestingly, replacing 'ubuntu:18.04' with 'python:3.7-slim' works. I thought this might mean it was an issue with the apt version of pip (which I know is dodgy), but adding a 'pip install --upgrade pip' didn't help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions