瀏覽代碼

macOS needs longer pauses to register a file time change

default_compile_flags
vector-of-bool 3 年之前
父節點
當前提交
5163481a17
共有 2 個檔案被更改,包括 2 行新增2 行删除
  1. +1
    -1
      tests/test_basics.py
  2. +1
    -1
      tests/test_compile_file.py

+ 1
- 1
tests/test_basics.py 查看文件

@@ -31,7 +31,7 @@ def test_build_simple(tmp_project: Project) -> None:
tmp_project.write('src/f.cpp', r'void f() {}')
tmp_project.build()
# Writing again will build again:
time.sleep(0.5) # Sleep long enough to register a file change
time.sleep(1) # Sleep long enough to register a file change
tmp_project.write('src/f.cpp', r'bad again')
with pytest.raises(CalledProcessError):
tmp_project.build()

+ 1
- 1
tests/test_compile_file.py 查看文件

@@ -16,7 +16,7 @@ def test_simple_compile_file(tmp_project: Project) -> None:
# No error:
tmp_project.compile_file('src/answer.cpp')
# Fail:
time.sleep(0.5)
time.sleep(1) # Sleep long enough to register a file change
tmp_project.write('src/answer.cpp', 'int get_answer() { return "How many roads must a man walk down?"; }')
with pytest.raises(subprocess.CalledProcessError):
tmp_project.compile_file('src/answer.cpp')

Loading…
取消
儲存