Skip to content

Up the tolerance for test.test_zipfile.test_core.OtherTests.test_write_without_source_date_epoch #149425

Description

@brettcannon

Bug report

Bug description:

I had test.test_zipfile.test_core.OtherTests.test_write_without_source_date_epoch fail with difference of 2 on the WASI buildbot.

def test_write_without_source_date_epoch(self):
with os_helper.EnvironmentVarGuard() as env:
del env['SOURCE_DATE_EPOCH']
with zipfile.ZipFile(TESTFN, "w") as zf:
zf.writestr("test_no_source_date_epoch.txt", "Testing without SOURCE_DATE_EPOCH")
with zipfile.ZipFile(TESTFN, "r") as zf:
zip_info = zf.getinfo("test_no_source_date_epoch.txt")
current_time = time.localtime()[:6]
for z_time, c_time in zip(zip_info.date_time, current_time):
self.assertAlmostEqual(z_time, c_time, delta=1)

The test probably just needs to allow a delta of 2.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions