skillfed

k5test

A library for testing Python applications in self-contained Kerberos 5 environments

k5test v0.10.4 164.5K downloads/30d#10,544 on PyPI9
Permissive license DORMANT released

What it is and what it does

k5test is a testing library that automates the setup and teardown of isolated Kerberos 5 environments for Python unit tests. Instead of manually configuring Kerberos realms or relying on system-wide Kerberos configuration, developers inherit from KerberosTestCase and get a self-contained test realm automatically provisioned before each test and cleaned up afterwards. This isolation is valuable for testing Kerberos-dependent applications without affecting production or shared Kerberos infrastructure.

The library also provides decorators to conditionally skip tests based on Kerberos version, GSSAPI extension availability, or installed plugins. It supports both MIT krb5 and Heimdal implementations and has been maintained since 2015, with support for Python 3.6 through 3.11. No runtime dependencies are required for basic use, though optional integration with python-gssapi enables extension-aware test skipping.

Use it for:

  • Test Kerberos authentication flows in isolation without modifying system Kerberos configuration.
  • Run GSSAPI-dependent unit tests with automatic environment setup and teardown per test case.
  • Skip tests conditionally when krb5 version is below a required minimum or when specific GSSAPI extensions are unavailable.
  • Validate Kerberos realm configuration and credential handling in a sandboxed environment.
  • Test applications that depend on Kerberos plugins without requiring those plugins in the test environment.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

k5test sets up isolated Kerberos 5 test environments and provides test case classes and decorators to run Python unit tests within those environments without affecting system Kerberos configuration.

Yes, if you are testing Kerberos or GSSAPI-dependent Python applications. The library eliminates manual Kerberos setup boilerplate and provides clean test isolation. However, note that maintenance is dormant (last release 877 days ago); if you need active support or compatibility with very recent Kerberos versions, evaluate whether the package still meets your requirements. For stable, long-term Kerberos testing needs, it remains a solid choice.

Install

k5test on PyPI

pip

pip install k5test

uv

uv add k5test

poetry

poetry add k5test

Installing k5test

Before you install

Low install friction with no runtime dependencies. Maintenance is dormant—last release was 877 days ago, though the repository remains active with a recent commit on 2024-11-11. Suitable for projects with stable Kerberos testing needs but not for active feature development.

License in practice

Dual-licensed under ISC and MIT, both permissive licenses. You can use, modify, and distribute the package freely with minimal restrictions.

Quickstart

pip install k5test

from k5test import KerberosTestCase

class MyKerberosTest(KerberosTestCase):
    def test_kerberos_operation(self):
        # Kerberos 5 environment is automatically set up
        pass

Requires MIT Kerberos 5 (krb5) or Heimdal to be installed on the system; k5test does not bundle Kerberos itself.

Verify before relying

  • Whether the dormant maintenance status (877 days since last release) affects compatibility with recent Kerberos versions or Python 3.10+.
  • Specific version requirements or known incompatibilities with particular krb5 or Heimdal releases.
  • Whether optional dependencies like python-gssapi are required for core functionality or only for decorator features.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 877 days since the last release
Last repo commit
First released
Downloads 164,543/month — #10,544 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: k5test-0.10.4-py2.py3-none-any.whl

Keywords: gssapi, security

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: ISC License (ISCL)License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Security

Tags

kerberos 5 testingkrb5 test environmentgssapi unit testingkerberos realm setupisolated kerberos testingkrb5 test harnesskerberos security testing
kerberosgssapitest-harness

More Security packages