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

WIP - Adding tests + testing healthcheck #10

Closed
wants to merge 2 commits into from

Conversation

machikoyasuda
Copy link
Member

@machikoyasuda machikoyasuda commented Sep 30, 2021

WIP WIP! - Made this PR to ask a question:

Having trouble importing app into the tests. I tried adding an test/__init__.py file which returns this error:

====================================================== ERRORS ======================================================
________________________________________ ERROR at setup of test_healthcheck ________________________________________

app = <function app at 0x7fbedf8b2550>

    @pytest.fixture
    def client(app):
        """A test client for the app."""
>       return app.test_client()
E       AttributeError: 'function' object has no attribute 'test_client'

tests/conftest.py:12: AttributeError

Removing that test/__init__.py file gets this error:

ImportError while loading conftest '/home/calitp/app/tests/conftest.py'.
tests/conftest.py:3: in <module>
    from app import app as flask_app
E   ModuleNotFoundError: No module named 'app'

@machikoyasuda machikoyasuda changed the base branch from main to config/dev-container September 30, 2021 22:22
@machikoyasuda machikoyasuda deleted the testing-healthcheck branch September 30, 2021 22:50
@thekaveman thekaveman added this to the October 2021 milestone Oct 13, 2021
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