Skip to content

Remove unittest#2044

Open
hulkoba wants to merge 6 commits intoconda-forge:mainfrom
neighbourhoodie:remove_unittest
Open

Remove unittest#2044
hulkoba wants to merge 6 commits intoconda-forge:mainfrom
neighbourhoodie:remove_unittest

Conversation

@hulkoba
Copy link

@hulkoba hulkoba commented Aug 29, 2024

Hello 👋!

As part of the STF work for Conda, this PR introduces several improvements to our testing framework by transitioning from unittest to pytest and leveraging pytest-mock for mocking.

It is split up from #1975.

Thank you!

Checklist

  • Added a news entry

@hulkoba hulkoba requested a review from a team as a code owner August 29, 2024 07:43
@hulkoba
Copy link
Author

hulkoba commented Aug 29, 2024

Linting fails because of an unused var F841 Local variable git_mock is assigned to but never used
But when I remove the line(s), the tests fail.



class TestFeedstockIO(unittest.TestCase):
class TestFeedstockIO:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit test executes the setup method before tests. If we simply remove the class inheritance here, I am not sure if that will happen or not given the code now. Can we convert the setup to a test fixture and the methods to functions?

self.assertEqual(write_text, read_text)
assert write_text == read_text

def tearDown(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment applies to teardown. This should be part of a test fixture IIUIC.



class TestLinter(unittest.TestCase):
class TestLinter:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The methods on this class should be converted to pure functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants