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

Time not frozen on class #31

Open
mblayman opened this issue Jun 7, 2021 · 0 comments
Open

Time not frozen on class #31

mblayman opened this issue Jun 7, 2021 · 0 comments

Comments

@mblayman
Copy link

mblayman commented Jun 7, 2021

My team is trying to upgrade from 0.3.0.post1 to 0.4.2. With that being the only change, some of tests start to fail with time related issues. I probably can't share too much of the code, but the interesting characteristics are that the mark is added to the class and there is a fixture within the class that the failing test uses. Here's the start fo the test case:

@pytest.mark.freeze_time("2020-04-01")
class TestMDProviderAvailability:
    @pytest.fixture()
    def scheduled_provider(self):
        now = timezone.now()
        shift_start = datetime(
            year=now.year, month=now.month, day=now.day, hour=8, minute=0, microsecond=0, tzinfo=timezone.utc
        )
        return ScheduledDoctorFactory(shift=shift_start)

We have also noticed the same problem on 0.4.1 so this behavior is not new 0.4.2. Could there be some issue with the freeze_time mark not applying to the nest fixture or something? Any thoughts about what might be going on? I can try to provide more data if this isn't enough to go on.

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

No branches or pull requests

1 participant