-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support testlib SPJ for grader #168
base: master
Are you sure you want to change the base?
Conversation
问题来了 test 怎么写 |
在 Windows 下的一个 Bug: 总之重定向到 stdout 的行为没有成功,大概是因为 |
windows 怎么这么不牛 只能走临时文件了 |
@weilycoder 没环境 你再试试 |
我认为我有必要先描述我的测试方法,以便后续讨论:
|
那么,现在有一个奇怪的行为: cyaron/cyaron/graders/testlib_checker.py Lines 33 to 36 in f82ae64
如果直接跑测试,报错(临时文件名可能不同):
将 34 行加上
继续在 35 行加上
在 33 行加上 |
然后如果改成这样,行为看起来就很对: with tempfile.TemporaryDirectory() as checker_output_dir, \
open(path_join(checker_output_dir, 'input.txt'), 'w', newline='\n') as inf, \
open(path_join(checker_output_dir, 'output.txt'), 'w', newline='\n') as outf, \
open(path_join(checker_output_dir, 'answer.txt'), 'w', newline='\n') as ansf:
... 并且如果出现错误可能报错信息也更可读(临时文件见名知意)。 |
所以是windows在关闭文件之前不会立即写入??? |
鬼知道啥行为? 我只是把 |
No description provided.