Переглянути джерело

macOS needs longer pauses to register a file time change

default_compile_flags
vector-of-bool 4 роки тому
джерело
коміт
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 Переглянути файл

tmp_project.write('src/f.cpp', r'void f() {}') tmp_project.write('src/f.cpp', r'void f() {}')
tmp_project.build() tmp_project.build()
# Writing again will build again: # 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') tmp_project.write('src/f.cpp', r'bad again')
with pytest.raises(CalledProcessError): with pytest.raises(CalledProcessError):
tmp_project.build() tmp_project.build()

+ 1
- 1
tests/test_compile_file.py Переглянути файл

# No error: # No error:
tmp_project.compile_file('src/answer.cpp') tmp_project.compile_file('src/answer.cpp')
# Fail: # 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?"; }') tmp_project.write('src/answer.cpp', 'int get_answer() { return "How many roads must a man walk down?"; }')
with pytest.raises(subprocess.CalledProcessError): with pytest.raises(subprocess.CalledProcessError):
tmp_project.compile_file('src/answer.cpp') tmp_project.compile_file('src/answer.cpp')

Завантаження…
Відмінити
Зберегти