Skip to content

Commit

Permalink
Clean-up, typing and docstrings for long cmd test
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Mar 5, 2024
1 parent 91afe0f commit 44f4388
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/darker/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import random
import re
import string
import sys
from argparse import ArgumentError
from io import BytesIO
from pathlib import Path
Expand All @@ -31,9 +30,10 @@
from darker.verification import NotEquivalentError


def randomword(length):
def randomword(length: int) -> str:
"""Create a random string of lowercase letters of a given length."""
letters = string.ascii_lowercase
return "".join(random.choice(letters) for _i in range(length))
return "".join(random.choice(letters) for _i in range(length)) # nosec


def _replace_diff_timestamps(text, replacement="<timestamp>"):
Expand Down Expand Up @@ -943,6 +943,7 @@ def test_stdout_path_resolution(git_repo, capsys):


def test_long_command_length(git_repo):
"""Large amount of changed files does not break Git invocation even on Windows"""
# For PR #542 - large character count for changed files
# on windows breaks subprocess
# Need to exceed 32762 characters
Expand Down

0 comments on commit 44f4388

Please sign in to comment.