Skip to content

Conversation

@Taragolis
Copy link
Contributor

Migrate all Apache providers tests to pytest.

All changes are more or less straightforward:

  • Get rid of unittests.TestCase class and TestCase.assert* methods
  • Replace decorator parameterized.expand by pytest.mark.parametrize. I
  • replace requests_mock.mock decorator by requests_mock fixture
  • Convert TestCase.subTest to parametrize tests
  • Convert classes setUp* and tearDown* to appropriate pytest methods

See additional findings in comments

Comment on lines 32 to -36
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TestDrillOperator has a bit strange decorator might be some typo or outdated stuff:

  • Backend drill not exists
  • Integration drill not exists but might be exists in the past

Copy link
Member

Choose a reason for hiding this comment

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

Indeed. I think drill has been missing in action :)

Comment on lines +103 to +107
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part previously exists in tests case methods.
Is a good idea get rid of this logger entirely?

Copy link
Member

Choose a reason for hiding this comment

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

Yep. We can get rid of it as a follow-up

Comment on lines +198 to +202
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as mention for TestHdfsSensorFolder

Copy link
Member

Choose a reason for hiding this comment

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

Same here. This seems to be a left-over and we should get rid of it as a follow-up.

Comment on lines -58 to -71
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This class only use once in the same module and also have the same name as reusable test class from tests/providers/apache/hive/__init__.py which may confuse

Copy link
Member

Choose a reason for hiding this comment

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

Yep.

@Taragolis Taragolis force-pushed the providers-test-pytests-apache branch from 2e6b09e to 7630d4d Compare November 27, 2022 21:35
@potiuk
Copy link
Member

potiuk commented Nov 27, 2022

Yeah. I really like the pytest conversions :)

@potiuk potiuk merged commit 3ea4739 into apache:main Nov 27, 2022
@Taragolis Taragolis deleted the providers-test-pytests-apache branch November 28, 2022 02:27
@Taragolis Taragolis added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Nov 30, 2022
ephraimbuddy pushed a commit that referenced this pull request Jan 13, 2023
ephraimbuddy pushed a commit that referenced this pull request Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants