Add gitutils tests (#71580)

Summary:
Test PeekableIterator behavior

Add `.github/scripts/test_*.py` to list of tests run by test_tools
workflow and pin Python version to 3.7 in test_tools workflow

Change PeekableIterator inheritance from collections.abc.Iterator, to
typing.Iterator, which is a correct alias starting from Python-3.7

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71580

Reviewed By: bigfootjon

Differential Revision: D33690659

Pulled By: malfet

fbshipit-source-id: 71f270b15138230772e2eed0da66cdfcb34825cc
(cherry picked from commit 42abb07396fa90272afb0b56508bd3a1f5c4ccbe)
This commit is contained in:
Nikita Shulga
2022-01-20 13:51:56 -08:00
committed by Eli Uriegas
parent 08b389fc36
commit bc608b6e16
3 changed files with 34 additions and 6 deletions

View File

@ -1,9 +1,8 @@
#!/usr/bin/env python3
from collections import defaultdict
from collections.abc import Iterator
from datetime import datetime
from typing import cast, Any, Dict, List, Optional, Tuple, Union
from typing import cast, Any, Dict, Iterator, List, Optional, Tuple, Union
import os
import re