Skip to content

Commit

Permalink
Fix source directory utime in unit test (#14595)
Browse files Browse the repository at this point in the history
We need to set mtime after generating our test data otherwise
we get invalid results.
  • Loading branch information
anodos325 committed Sep 30, 2024
1 parent 82ae278 commit b1aa74d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/unit/test_copytree.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def create_test_data(target: str, symlink_target_path) -> None:
os.setxattr(source, xat_name, xat_data)

os.chown(source, JENNY + 10, JENNY + 11)
os.utime(source, ns=(JENNY + 5, JENNY + 6))
os.chmod(source, 0o777)

create_test_files(source, symlink_target_path)
Expand Down Expand Up @@ -110,6 +109,8 @@ def create_test_data(target: str, symlink_target_path) -> None:
create_test_files(path, os.path.join(target, dirname))
os.utime(path, ns=(JENNY + 3, JENNY + 4))

os.utime(source, ns=(JENNY + 5, JENNY + 6))


@pytest.fixture(scope="function")
def directory_for_test(tmpdir):
Expand Down

0 comments on commit b1aa74d

Please sign in to comment.