Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow ignoring all other args in for_call except those specified #309

Closed
wants to merge 4 commits into from

Conversation

deathowl
Copy link
Member

What:
Allow asserting only some call arguments as requested

Why:
Feature request

How:

Add new argument ignore_other_args and ignore_other_kwargs for mock_callable and mock_async_callable
Change get base_runner.can_accept_args to return True if provided args match, if any of the switches provided
Risks:

Checklist:

  • Added tests, if you've added code that should be tested
  • Updated the documentation, if you've changed APIs
  • Ensured the test suite passes
  • Made sure your code lints
  • Completed the Contributor License Agreement ("CLA")

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jul 13, 2021
@facebook-github-bot
Copy link

@deathowl has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@coveralls
Copy link

coveralls commented Jul 13, 2021

Pull Request Test Coverage Report for Build 1277456089

  • 17 of 18 (94.44%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 94.171%

Changes Missing Coverage Covered Lines Changed/Added Lines %
testslide/mock_callable.py 17 18 94.44%
Totals Coverage Status
Change from base Build 1258430837: -0.01%
Covered Lines: 2617
Relevant Lines: 2779

💛 - Coveralls

@fornellas
Copy link
Contributor

Have you considered using for_partial_call_args to keep the idiom of for_call?

… for_call as recommended by @fornellas.

Also added more tests, and moved docs around
@facebook-github-bot
Copy link

@deathowl has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

@deathowl has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

@deathowl has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants