kovidgoyal/kitty · error

Unknown test type: %s

Error message

Unknown test type: %s

What it means

kitten's internal pytest helper dispatches on args[0] and only recognizes specific test types (read, etc.). Any other first argument yields this error with exit code 1.

Source

Thrown at tools/cmd/pytest/main.go:20

package pytest

import (
	"fmt"
	"io"
	"os"

	"github.com/kovidgoyal/go-shm"
	"github.com/kovidgoyal/kitty/kittens/ssh"
	"github.com/kovidgoyal/kitty/tools/cli"
)

var _ = fmt.Print

func test_integration_with_python(args []string) (rc int, err error) {
	switch args[0] {
	default:
		return 1, fmt.Errorf("Unknown test type: %s", args[0])
	case "read":
		data, err := shm.ReadWithSizeAndUnlink(args[1])
		if err != nil {
			return 1, err
		}
		_, err = os.Stdout.Write(data)
		if err != nil {
			return 1, err
		}
	case "write":
		data, err := io.ReadAll(os.Stdin)
		if err != nil {
			return 1, err
		}
		mmap, err := shm.CreateTemp("shmtest-", uint64(len(data)+shm.NUM_BYTES_FOR_SIZE))
		if err != nil {
			return 1, err
		}

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Do not invoke this internal command directly; it exists for kitty's own test suite
  2. If writing kitty integration tests, use only the documented test types in the switch (e.g. read)
  3. Update to a matching kitty source tree if test harness and binary versions diverged
Defensive patterns

Strategy: validation

Validate before calling

known := map[string]bool{"read": true}
if !known[args[0]] { return 1, fmt.Errorf("unsupported test type %q", args[0]) }

Prevention

When it happens

Trigger: Invoking the hidden pytest integration command with an unrecognized subcommand token, e.g. `kitten pytest foo ...` where foo is not in the switch.

Common situations: This is an internal testing shim for kitty's Python integration tests; end users normally never call it — hitting it means an internal test harness was invoked with a wrong or outdated test type name.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/700ff9d8e3bb8622. Report an issue: GitHub.