slackapi / slackapi/python-slack-sdk

Writing unit tests for an app using this SDK

Open
#1,188 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion enhancement tests Version: 3x
Dominant language
Python
Stars
4k
Forks
857
Avg merge
22h 21m
Merged PRs (30d)
16

Description

I have seen mentions of unit tests in some issues like this one: https://github.com/slackapi/python-slack-sdk/issues/1052

But the documentation does not mention how we can write unit tests in our code if we integrate the slack sdk in our code base.

We use pytest along with moto3 to mock AWS APIs, for example. Is there something similar we can do for this slack sdk or do we have to make our own fixtures to make the unit tests work?

Contributor guide

Open the contributing guide

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.

Research direction

Start by reviewing the testing discussion in issue #1052 and the SDK's existing documentation. Document the supported approach for unit testing SDK integrations, including whether reusable fixtures or mocks are available and what a complete pytest example should cover.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation, testing
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.