Skip to content

Commit fe1fb87

Browse files
committed
test(utils): do not create file for simplicity
1 parent a472bea commit fe1fb87

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

tests/utils.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import sys
44
import time
5-
import uuid
6-
from pathlib import Path
75

86
import pytest
97
from deprecated import deprecated
@@ -28,17 +26,12 @@ def __init__(self, out=None, err=None, return_code=0):
2826
self.return_code = return_code
2927

3028

31-
def create_file_and_commit(
32-
message: str, filename: str | None = None, committer_date: str | None = None
33-
):
34-
if not filename:
35-
filename = str(uuid.uuid4())
36-
37-
Path(filename).touch()
38-
c = cmd.run("git add .")
29+
# TODO: rename this function when the tests are stable (nobody is changing it)
30+
def create_file_and_commit(message: str, committer_date: str | None = None):
31+
c = cmd.run("git add .") # prevent untracked files errors
3932
if c.return_code != 0:
4033
raise exceptions.CommitError(c.err)
41-
c = git.commit(message, committer_date=committer_date)
34+
c = git.commit(message, "--allow-empty", committer_date)
4235
if c.return_code != 0:
4336
raise exceptions.CommitError(c.err)
4437

0 commit comments

Comments
 (0)