pytest-emoji is a pytest plugin that enhances your test result reports by replacing standard indicators with expressive emojis. It offers clear visual feedback for passed, failed, skipped, xfailed, xpassed, and error states, making test output more engaging and easier to parse at a glance. The plugin is currently at version 0.2.0 and maintains a steady cadence as part of the pytest ecosystem.
pip install pytest-emojiNo compatibility data collected yet for this library.
Install the plugin, then simply run `pytest` with the `--emoji` flag to enable the emoji reporting. The plugin integrates seamlessly, replacing standard test indicators with emojis for both normal and verbose output modes.
If you have custom `pytest_emoji_*` hooks in your `conftest.py` that access `pytest.config`, modify them to accept `config` as an argument (e.g., `def pytest_emoji_passed(config):`). Access configuration attributes via this `config` argument.
Ensure your terminal emulator supports Unicode and a font that includes emoji characters. Using a modern terminal like Windows Terminal, iTerm2, or setting your locale to a UTF-8 compatible one can resolve this. This is typically an environment configuration issue, not a `pytest-emoji` bug.
Run pytest with the `--emoji` flag: `pytest --emoji` (for normal output) or `pytest --verbose --emoji` (for verbose output).
Update your custom `pytest_emoji_*` hooks to accept the `config` object as an argument and use that for configuration access. For example, change `def pytest_emoji_passed(): ...` to `def pytest_emoji_passed(config): ...`.