Skip to content

test(distros): Convert test_hostname.py from unittest to pytest#6511

Merged
blackboxsw merged 1 commit into
canonical:mainfrom
Pneha1234:pytest-convert-test-hostname
Oct 16, 2025
Merged

test(distros): Convert test_hostname.py from unittest to pytest#6511
blackboxsw merged 1 commit into
canonical:mainfrom
Pneha1234:pytest-convert-test-hostname

Conversation

@Pneha1234
Copy link
Copy Markdown
Contributor

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

  • Removed unittest import
  • Removed TestCase inheritance
  • Converted self.assertEqual() methods to bare assert statements
  • Maintained all original test functionality

Related: #6427

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

- Removed unittest import

- Removed TestCase inheritance

- Converted self.assertEqual() methods to bare assert statements

- 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.

Ship it!. Keep this goodness coming. Thank you for the contribution.

@blackboxsw blackboxsw merged commit c64fce3 into canonical:main Oct 16, 2025
21 checks passed
@Pneha1234
Copy link
Copy Markdown
Contributor Author

Appreciate it!

blackboxsw pushed a commit to blackboxsw/cloud-init that referenced this pull request Dec 12, 2025
…nical#6511)

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

- Removed unittest import
- Removed TestCase inheritance
- Converted self.assertEqual() methods to bare assert statements
- 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_hostname.py to use
pytest instead of unittest.TestCase as part of the pytest migration effort.

- Removed unittest import
- Removed TestCase inheritance
- Converted self.assertEqual() methods to bare assert statements
- 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