Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tmux-python/libtmux
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.42.1
Choose a base ref
...
head repository: tmux-python/libtmux
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.43.0
Choose a head ref
  • 11 commits
  • 13 files changed
  • 1 contributor

Commits on Feb 15, 2025

  1. docs: Make topics reappear

    tony committed Feb 15, 2025
    Configuration menu
    Copy the full SHA
    44fe656 View commit details
    Browse the repository at this point in the history
  2. feat(server): Add socket_name_factory and on_init callbacks

    Add two new optional parameters to Server constructor:
    
    - socket_name_factory: Callable[[], str]
      Generates unique socket names for new servers. Used when socket_name
      is not provided. Useful for creating multiple servers with unique names.
    
    - on_init: Callable[[Server], None]
      Callback that runs after server initialization. Useful for tracking
      server instances and performing cleanup in tests.
    
    The socket_name_factory is tried after socket_name, maintaining backward
    compatibility while adding flexibility for dynamic socket name generation.
    
    Example:
    
    def socket_name_factory() -> str:
        return f"tmux_{next(counter)}"
        server = Server(socket_name_factory=socket_name_factory)
    
    This enables better testing patterns and more flexible server creation,
    particularly in test environments where unique socket names are needed.
    tony committed Feb 15, 2025
    Configuration menu
    Copy the full SHA
    ebee84c View commit details
    Browse the repository at this point in the history
  3. feat(pytest): Add TestServer fixture for test server management

    Adds a new pytest fixture TestServer that returns a factory for creating
    tmux servers with unique socket names. Each server is automatically cleaned
    up when the test completes.
    
    The fixture provides:
    - Factory function returning partial'd Server instances
    - Unique socket names for each server instance
    - Automatic cleanup through pytest's addfinalizer
    - Support for custom tmux configs in tests
    
    Example usage:
    
    def test_example(TestServer):
        Server = TestServer() # Get partial'd Server
        server = Server() # Create server instance
        server.new_session()
    tony committed Feb 15, 2025
    Configuration menu
    Copy the full SHA
    135add8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c2d5368 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    87ce76c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f79993a View commit details
    Browse the repository at this point in the history
  7. TestServer: Server, but partial'd to run on a test socket (#565)

    #### New `Server` params
    
    `Server` now accepts 2 new optional params, `socket_name_factory` and `on_init` callbacks (#565):
    
    - `socket_name_factory`: Callable that generates unique socket names for new servers
    - `on_init`: Callback that runs after server initialization
    - Useful for creating multiple servers with unique names and tracking server instances
    - Socket name factory is tried after socket_name, maintaining backward compatibility
    
    #### New test fixture: `TestServer`
    
    Add `TestServer` pytest fixture for creating temporary tmux servers (#565):
    
    - Creates servers with unique socket names that clean up after themselves
    - Useful for testing interactions between multiple tmux servers
    - Includes comprehensive test coverage and documentation
    - Available in doctest namespace
    tony authored Feb 15, 2025
    Configuration menu
    Copy the full SHA
    4a08aa1 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    873ab26 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    283ee32 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5d3e428 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9018da6 View commit details
    Browse the repository at this point in the history
Loading