Skip to content

test(distros): Convert test_resolv.py from unittest to pytest#6504

Merged
blackboxsw merged 1 commit into
canonical:mainfrom
csemanish12:pytest-resolv-migration
Oct 13, 2025
Merged

test(distros): Convert test_resolv.py from unittest to pytest#6504
blackboxsw merged 1 commit into
canonical:mainfrom
csemanish12:pytest-resolv-migration

Conversation

@csemanish12
Copy link
Copy Markdown
Contributor

Refactored tests/unittests/distros/test_resolv.py to use pytest instead of unittest.TestCase as part of the pytest migration effort.

  • Removed TestCase inheritance
  • Converted self.assert* methods to bare assert statements
  • Replaced self.assertRaises with pytest.raises context manager
  • Maintained all original test functionality

Related: #6427

Refactored tests/unittests/distros/test_resolv.py to use pytest instead of
unittest.TestCase as part of the pytest migration effort.

- Removed TestCase inheritance
- Converted self.assert* methods to bare assert statements
- Replaced self.assertRaises with pytest.raises context manager
- Maintained all original test functionality

Related: canonical#6427
Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

Thank you much for this cleanup @csemanish12 and making cloud-init easier to maintain.

@blackboxsw blackboxsw merged commit e2715ef into canonical:main Oct 13, 2025
21 checks passed
@csemanish12
Copy link
Copy Markdown
Contributor Author

Happy to help

csemanish12 added a commit to csemanish12/cloud-init that referenced this pull request Oct 14, 2025
Refactored tests/unittests/distros/test_sysconfig.py to use pytest instead of
unittest.TestCase as part of the pytest migration effort.

  - Removed TestCase inheritance
  - Converted self.assert* methods to bare assert statements
  - Maintained all original test functionality

  Related: canonical#6427
blackboxsw pushed a commit to blackboxsw/cloud-init that referenced this pull request Dec 12, 2025
Refactored tests/unittests/distros/test_resolv.py to use pytest instead of
unittest.TestCase as part of the pytest migration effort.

- Removed TestCase inheritance
- Converted self.assert* methods to bare assert statements
- Replaced self.assertRaises with pytest.raises context manager
- Maintained all original test functionality

Related: canonical#6427
holmanb pushed a commit that referenced this pull request Dec 18, 2025
Refactored tests/unittests/distros/test_resolv.py to use pytest instead of
unittest.TestCase as part of the pytest migration effort.

- Removed TestCase inheritance
- Converted self.assert* methods to bare assert statements
- Replaced self.assertRaises with pytest.raises context manager
- Maintained all original test functionality

Related: #6427
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