Skip to content

Time not frozen on class #31

@mblayman

Description

@mblayman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions