Skip to content

Fix unit tests for pytest >=8 - #70156

Open
m-czernek wants to merge 1 commit into
saltstack:masterfrom
m-czernek:pytest-fixes
Open

Fix unit tests for pytest >=8#70156
m-czernek wants to merge 1 commit into
saltstack:masterfrom
m-czernek:pytest-fixes

Conversation

@m-czernek

Copy link
Copy Markdown
Contributor

What does this PR do?

Pytest >= 8 expects the runTest function to be defined. Without this dummy definition, tests will fail to load, e.g.:

04:28:49  ERROR tests/unit/transport/test_tcp.py::AsyncTestCase - AttributeError: 'AsyncTestCase' object has no attribute 'runTest'
04:28:49  ERROR tests/unit/transport/test_tcp.py::AsyncPubServerTest - AttributeError: 'AsyncPubServerTest' object has no attribute 'runTest'

I believe Salt is in the process of migrating these tests to pytest. In the meantime, this change enables the tests to be executed with the new pytest.

What issues does this PR fix or reference?

Previous Behavior

Tests fail to load.

New Behavior

Test can execute with both the old and new pytest.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

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.

1 participant