Create pytest fixtures for integration tests

Open
#143 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
testing-qa

Research direction

Start by reading the existing integration tests and the package's current entry-point configuration. Define the fixture interface against the library's actual server and client APIs, then verify that the fixture is automatically available when the IRC library is installed in the test environment.

Written by the indexing model from the issue text.

Description

enhancement help wanted

I imagine one could create a pytest fixture, one which starts the server and provides convenience functions for common assertions, such that a test could look something like:

def test_server_receives_message(irc_server):
    client = irc_server.get_client(nick=’test_user')
    client.pubmesg(“#test-channel”, “Hello message”)
    assert irc_server.get_last_message().nick == ‘test_user’
    assert irc_server.get_last_message().type == ‘pubmsg’
    assert irc_server.get_last_message().message_text.startswith(“Hello”)

Note, that is not a spec, but more of a sketch of the idea. The actual interface would need to use names and methods that match the spec/implementation.

The test would be exposed through entry points such that the mere presence of this irc library in the test environment would make that fixture available.

Dominant language
Python
Stars
422
Forks
91
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jaraco/irc

All issues in jaraco/irc

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.