Skip to content
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

test: migrate from unittest to pytest #1819

Closed
efiop opened this issue Apr 1, 2019 · 9 comments
Closed

test: migrate from unittest to pytest #1819

efiop opened this issue Apr 1, 2019 · 9 comments
Labels
enhancement Enhances DVC p3-nice-to-have It should be done this or next sprint

Comments

@efiop
Copy link
Member

efiop commented Apr 1, 2019

Need to stop using unittest's TestCase and use pytest instead.

@efiop efiop added p3-nice-to-have It should be done this or next sprint enhancement Enhances DVC labels Apr 1, 2019
@Suor
Copy link
Contributor

Suor commented Dec 5, 2019

Should we raise this in priority?

Also, looks like we have 3 parts here:

  • migrate test_data_cloud.py, look at tests/remotes.py
  • migrate external dep tests
  • migrate all other unit tests

@efiop
Copy link
Member Author

efiop commented Dec 5, 2019

@Suor This one is still nice-to-have, but it doesn't mean that we can't take it 🙂 Considering the data_cloud complications, I suspect that it will take a bit longer to resolve this one, so I would take it after we migrate to new fixtures. Let's not add this one to the sprint for now.

@Suor
Copy link
Contributor

Suor commented Jan 18, 2020

Maybe open a free hunt on it? @efiop @MrOutis @pared @skshetry?

@efiop
Copy link
Member Author

efiop commented Jan 19, 2020

@Suor Let's not do that in this sprint for now, let's deal with what we have for now. Could consider including into the next one though, let's discuss on grooming.

@efiop efiop added this to To do in DVC 16 - 30 June 2020 via automation Jun 16, 2020
@efiop
Copy link
Member Author

efiop commented Jun 17, 2020

Migrating tests/func/test_data_cloud.py

@skshetry
Copy link
Member

skshetry commented May 13, 2021

The unittest based tests have started to rot as we rarely update them compared to the fixtures. The diskcache changes removed the repo.state context manager, which made the tests prone to failure raising PermissionError in Windows as we were not closing the sqlite connection (which we still aren't). It was quite easy to debug and fix on pytest, but quite difficult on unittest based tests. Also to solve it, I had to add more hacks which I don't like (see: #5962). 😞

@nik123
Copy link
Contributor

nik123 commented Sep 2, 2021

In one of my PRs I've been asked #6339 (comment) to replace unittest.mock with pytest-mock. Is replacement of unittest.mock with pytest-mock is a part of this issue?

@karajan1001
Copy link
Contributor

In one of my PRs I've been asked #6339 (comment) to replace unittest.mock with pytest-mock. Is replacement of unittest.mock with pytest-mock is a part of this issue?

I think so.

@skshetry
Copy link
Member

Closed by #8523.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances DVC p3-nice-to-have It should be done this or next sprint
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants