Create pytest fixtures for integration tests
- Dominant language
- Python
- Stars
- 421
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
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.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100