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

Added option to pass in the factory to a decorated class #210

Merged
merged 1 commit into from
Nov 4, 2017
Merged

Added option to pass in the factory to a decorated class #210

merged 1 commit into from
Nov 4, 2017

Conversation

terricain
Copy link

I have a few examples in the Moto project where we have the following code which will freeze time for the mocked moto service its wrapping.

@freeze_time("2016-01-01")
@mock_someservice
def test_something():
    # Do some stuff

We could do with being able to advance time whilst in the test case. So the patch provides the following functionality whilst still remaining backwards compatible

@freeze_time("2016-01-01", as_arg=True)
@mock_someservice
def test_something(frozen_time):
    # Do some stuff
    frozen_time.move_to("2016-02-01")
    # Do more stuff

@coveralls
Copy link

coveralls commented Sep 22, 2017

Coverage Status

Coverage decreased (-0.2%) to 95.733% when pulling 503f6e4 on terrycain:master into 385a78d on spulec:master.

@spulec spulec merged commit 7ad16a5 into spulec:master Nov 4, 2017
@spulec
Copy link
Owner

spulec commented Nov 4, 2017

Awesome, thanks!

@tricard-eb
Copy link

When can we expect a release with that ?

@spulec
Copy link
Owner

spulec commented Mar 6, 2018

Version 0.3.10 has now been released.

@tricard-eb
Copy link

awesome! thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants