Skip to content

Commit 065b3ef

Browse files
committed
code review cleanups
1 parent 122e53e commit 065b3ef

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

mypyc/test/test_run.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from mypyc.test.testutil import (
2626
ICODE_GEN_BUILTINS, TESTUTIL_PATH,
2727
use_custom_builtins, MypycDataSuite, assert_test_output,
28-
show_c
28+
show_c, fudge_dir_mtimes,
2929
)
3030
from mypyc.test.test_serialization import check_serialization_roundtrip
3131

@@ -99,15 +99,6 @@ def chdir_manager(target: str) -> Iterator[None]:
9999
os.chdir(dir)
100100

101101

102-
def fudge_dir_mtimes(dir: str, delta: int) -> None:
103-
for dirpath, _, filenames in os.walk(dir):
104-
for name in filenames:
105-
# if name.endswith(('.c', '.h')): continue
106-
path = os.path.join(dirpath, name)
107-
new_mtime = os.stat(path).st_mtime + delta
108-
os.utime(path, times=(new_mtime, new_mtime))
109-
110-
111102
class TestRun(MypycDataSuite):
112103
"""Test cases that build a C extension and run code."""
113104
files = files

mypyc/test/testutil.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,11 @@ def show_c(cfiles: List[List[Tuple[str, str]]]) -> None:
195195
print('== {} =='.format(cfile))
196196
print_with_line_numbers(ctext)
197197
heading('End C')
198+
199+
200+
def fudge_dir_mtimes(dir: str, delta: int) -> None:
201+
for dirpath, _, filenames in os.walk(dir):
202+
for name in filenames:
203+
path = os.path.join(dirpath, name)
204+
new_mtime = os.stat(path).st_mtime + delta
205+
os.utime(path, times=(new_mtime, new_mtime))

0 commit comments

Comments
 (0)