Skip to content
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

Fix TestContext warning #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AleHD
Copy link
Contributor

@AleHD AleHD commented Apr 29, 2024

When you run any test that uses TestContext you will get some warnings like this:

====================================================================== warnings summary ======================================================================
tests/helpers/context.py:7: 35 warnings                                        
  /mloscratch/homes/alhernan/project/workspace/nanotron/tests/helpers/context.py:7: PytestCollectionWarning: cannot collect test class 'TestContext' because i
t has a __init__ constructor (from: test_serialize.py)                         
    class TestContext:                                                         
                                                                               
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html                                                                                       
======================================================== 19 passed, 8 skipped, 35 warnings in 25.47s =========================================================

This can be easily fixed by setting __test__ = False in the TestContext class. This PR fixes those warnings.

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