Refactorize tests to use Dataset as context manager
MEMBER
I find very interesting that idea of using a fixture instead!

Let me rework a little bit this PR, @lhoestq.
2021-04-12T07:08:41Z
https://github.com/huggingface/datasets/pull/2191#issuecomment-817547201
https://api.github.com/repos/huggingface/datasets/issues/2191
MDEyOklzc3VlQ29tbWVudDgxNzU0NzIwMQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/817547201/reactions
2021-04-12T07:08:41Z
https://api.github.com/repos/huggingface/datasets/issues/comments/817547201
https://avatars.githubusercontent.com/u/8515462?v=4
https://api.github.com/users/albertvillanova/events{/privacy}
https://api.github.com/users/albertvillanova/followers
https://api.github.com/users/albertvillanova/following{/other_user}
https://api.github.com/users/albertvillanova/gists{/gist_id}
https://github.com/albertvillanova
albertvillanova
MDQ6VXNlcjg1MTU0NjI=
https://api.github.com/users/albertvillanova/orgs
https://api.github.com/users/albertvillanova/received_events
https://api.github.com/users/albertvillanova/repos
https://api.github.com/users/albertvillanova/starred{/owner}{/repo}
https://api.github.com/users/albertvillanova/subscriptions
User
https://api.github.com/users/albertvillanova
public
MEMBER
@lhoestq, as this is a big refactoring, I had many problems to solve the conflicts with the master branch...

Therefore, I think it is better to merge this as it is, and then to make other PRs with additional refactorings, before I get conflicts again with the master branch...
2021-04-13T15:12:00Z
https://github.com/huggingface/datasets/pull/2191#issuecomment-818814698
https://api.github.com/repos/huggingface/datasets/issues/2191
MDEyOklzc3VlQ29tbWVudDgxODgxNDY5OA==
https://api.github.com/repos/huggingface/datasets/issues/comments/818814698/reactions
2021-04-13T15:15:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/818814698
https://avatars.githubusercontent.com/u/8515462?v=4
https://api.github.com/users/albertvillanova/events{/privacy}
https://api.github.com/users/albertvillanova/followers
https://api.github.com/users/albertvillanova/following{/other_user}
https://api.github.com/users/albertvillanova/gists{/gist_id}
https://github.com/albertvillanova
albertvillanova
MDQ6VXNlcjg1MTU0NjI=
https://api.github.com/users/albertvillanova/orgs
https://api.github.com/users/albertvillanova/received_events
https://api.github.com/users/albertvillanova/repos
https://api.github.com/users/albertvillanova/starred{/owner}{/repo}
https://api.github.com/users/albertvillanova/subscriptions
User
https://api.github.com/users/albertvillanova
public
MEMBER
There are still some conflicts that prevent merging.
Moreover I noticed that you added one fixture per method of the Dataset object to be mocked. The code of all these fixtures is pretty much the same, feel free to factorize them into one fixture.

Also feel free to create another branch from `master` if you don't want to fix the conflicts of this branch.
Let me know if I can help you on this
2021-04-14T14:33:54Z
https://github.com/huggingface/datasets/pull/2191#issuecomment-819566230
https://api.github.com/repos/huggingface/datasets/issues/2191
MDEyOklzc3VlQ29tbWVudDgxOTU2NjIzMA==
https://api.github.com/repos/huggingface/datasets/issues/comments/819566230/reactions
2021-04-14T14:33:54Z
https://api.github.com/repos/huggingface/datasets/issues/comments/819566230
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
MEMBER
@lhoestq, yes, the new conflicts appeared after today merge commits on master...

I am definitely going to split this PR into smaller ones in order to avoid having to resolve many conflicts after each commit on master. There are lots of conflicts and these are painful to resolve.
2021-04-14T15:25:53Z
https://github.com/huggingface/datasets/pull/2191#issuecomment-819606471
https://api.github.com/repos/huggingface/datasets/issues/2191
MDEyOklzc3VlQ29tbWVudDgxOTYwNjQ3MQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/819606471/reactions
2021-04-14T15:26:44Z
https://api.github.com/repos/huggingface/datasets/issues/comments/819606471
https://avatars.githubusercontent.com/u/8515462?v=4
https://api.github.com/users/albertvillanova/events{/privacy}
https://api.github.com/users/albertvillanova/followers
https://api.github.com/users/albertvillanova/following{/other_user}
https://api.github.com/users/albertvillanova/gists{/gist_id}
https://github.com/albertvillanova
albertvillanova
MDQ6VXNlcjg1MTU0NjI=
https://api.github.com/users/albertvillanova/orgs
https://api.github.com/users/albertvillanova/received_events
https://api.github.com/users/albertvillanova/repos
https://api.github.com/users/albertvillanova/starred{/owner}{/repo}
https://api.github.com/users/albertvillanova/subscriptions
User
https://api.github.com/users/albertvillanova
public
Refactorize Dataset tests to use Dataset as context manager.