Skip to content
Snippets Groups Projects

test: properly scope file write in a test

Merged Pierre-Yves David requested to merge marmoute/swh-model:pypy-fixes into master

This test work with cpython because as we do not assign the open file to a variable, the reference counting garbage collect it right after the write call. Deleting the file object mean the write is flushed.

On an interpreter without reference counting, as pypy, the file object might be garbaged collected too late, breaking the test.

So we give the file object a clear life cycle.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading