-
Notifications
You must be signed in to change notification settings - Fork 213
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
Convert unittest.TestCase tests to pytest #3425
Comments
@AetherUnbound Hello, Can this be assign to me? |
@AetherUnbound There are some errors from running ingestion_server. I'm not sure if I'm setting up the right credentials to run test on ingestion-server. The initial run
I cancel the run and re-run
Are you able to reproduce these errors? |
Hmm, I'm not seeing those errors when I run things locally 😮 can you try a few things?
And then try |
@AetherUnbound Thank you for giving the suggestions. In the end, I got a macbook and the error doesn't exist anymore. It was an investment to make on getting a new laptop during the holiday.
I tried various ways to use setUpClass as a pytest.fixture, call it only on the first test because there might be a duplicate error. I'm not sure how to use declare
Please provide any guidance on |
Glad you were able to get that first issue worked out!
I think you may want to look into fixture scope for this! I believe setting the scope to |
Thank you for the advice! I will look into it. |
Description
Most of our tests are set up in the functional format that pytest expects. We have two exceptions:
catalog/tests/dags/common/sensors/test_single_run_external_dags_sensor.py
ingestion_server/test/integration_test.py
Both of these tests use
unittest.TestCase
instead of individual test functions, and both should be able to be converted to pytest-formatted tests.TestCase
-based tests don't allow the use of fixtures, which hinders the simplicity of some tests (see #3361 (comment)).Examples of other pytest-formatted tests can be found throughout the
catalog/tests
directory.Additional context
This came up as part of #3361, and the workarounds created in that PR should be removed when the tests are converted.
The text was updated successfully, but these errors were encountered: