René's URL Explorer Experiment


Title: Pytest issues · Issue #44 · whythawk/full-stack-fastapi-postgresql · GitHub

Open Graph Title: Pytest issues · Issue #44 · whythawk/full-stack-fastapi-postgresql

X Title: Pytest issues · Issue #44 · whythawk/full-stack-fastapi-postgresql

Description: Been having a ton of trouble running the scripts/test-local.sh as instructed in the README. I keep running into ModulenotFoundError issues in backend/app/app/tests/conftest.py I've confirmed the following are working: My backend Docker c...

Open Graph Description: Been having a ton of trouble running the scripts/test-local.sh as instructed in the README. I keep running into ModulenotFoundError issues in backend/app/app/tests/conftest.py I've confirmed the fo...

X Description: Been having a ton of trouble running the scripts/test-local.sh as instructed in the README. I keep running into ModulenotFoundError issues in backend/app/app/tests/conftest.py I've confirmed th...

Opengraph URL: https://github.com/whythawk/full-stack-fastapi-postgresql/issues/44

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Pytest issues","articleBody":"Been having a ton of trouble running the `scripts/test-local.sh` as instructed in the `README`. I keep running into `ModulenotFoundError` issues in `backend/app/app/tests/conftest.py` I've confirmed the following are working:\r\n\r\n1. My backend Docker container is copying over `backend/app` to `/app` as expected.\r\n2. `/app` is getting set as the Python path as expected.\r\n3. Imports work normally when `bash`'d into the backend container.\r\n4. Imports work normally when running the backend service.\r\n5. `sys.path` contains `/app` as expected (I print it out while running `pytest -s`).\r\n\r\nHowever, no matter how I seem to run `pytest` (`bash`'d into the backend service, `docker compose run backend pytest`, or the `test-local.sh` script), I get the following error:\r\n\r\n```\r\n==================================================================================================== ERRORS ====================================================================================================\r\n________________________________________________________________________________________ ERROR collecting test session _________________________________________________________________________________________\r\n/usr/local/lib/python3.10/site-packages/_pytest/config/__init__.py:641: in _importconftest\r\n    mod = import_path(conftestpath, mode=importmode, root=rootpath)\r\n/usr/local/lib/python3.10/site-packages/_pytest/pathlib.py:567: in import_path\r\n    importlib.import_module(module_name)\r\n/usr/local/lib/python3.10/importlib/__init__.py:126: in import_module\r\n    return _bootstrap._gcd_import(name[level:], package, level)\r\n\u003cfrozen importlib._bootstrap\u003e:1050: in _gcd_import\r\n    ???\r\n\u003cfrozen importlib._bootstrap\u003e:1027: in _find_and_load\r\n    ???\r\n\u003cfrozen importlib._bootstrap\u003e:1006: in _find_and_load_unlocked\r\n    ???\r\n\u003cfrozen importlib._bootstrap\u003e:688: in _load_unlocked\r\n    ???\r\n/usr/local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:186: in exec_module\r\n    exec(co, module.__dict__)\r\napp/tests/conftest.py:14: in \u003cmodule\u003e\r\n    from app.core.config import settings\r\nE   ModuleNotFoundError: No module named 'app.core'\r\n```\r\n\r\nWhen I try to append an extra `app.` to the imports (e.g., `from app.app.core.config import settings`, the error goes away, but then my regular backend service crashes (ModuleNotFoundError `app.app`). Clearly it is some difference between how pytest and running the service regularly handle imports.\r\n\r\nMy file structure is the same as the template project: the `main.py` for FastAPI lives at `backend/app/app`, my `pyproject.toml` lives at `backend/app`. \r\n\r\nI am running `pytest 7.1.3`, `python 3.10`, and Mac OS 14.1. \r\n","author":{"url":"https://github.com/jmwebb","@type":"Person","name":"jmwebb"},"datePublished":"2023-12-12T05:52:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/44/full-stack-fastapi-postgresql/issues/44"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f4361a16-8be7-b3c8-7e86-135e887cba59
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD742:113E13:5C9FAC:791E61:698E5D53
html-safe-noncecccbe6d802ed4d767f1ef4ac4d0d77689dadeec43c8ba7bb26672cac52bc4106
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzQyOjExM0UxMzo1QzlGQUM6NzkxRTYxOjY5OEU1RDUzIiwidmlzaXRvcl9pZCI6Ijg0MzQxMTIxMDIyMzUyNjYzODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac84fee41ded62ed89cf539380fd9437e272cc9cae4b688ea91de00cc8d4afcb1a
hovercard-subject-tagissue:2037034248
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/whythawk/full-stack-fastapi-postgresql/44/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ad14d039eed76d9ea1111b4f0f9bf341e437667b502a4e40e29f51dd6d33e982/whythawk/full-stack-fastapi-postgresql/issues/44
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ad14d039eed76d9ea1111b4f0f9bf341e437667b502a4e40e29f51dd6d33e982/whythawk/full-stack-fastapi-postgresql/issues/44
og:image:altBeen having a ton of trouble running the scripts/test-local.sh as instructed in the README. I keep running into ModulenotFoundError issues in backend/app/app/tests/conftest.py I've confirmed the fo...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejmwebb
hostnamegithub.com
expected-hostnamegithub.com
None666e30cc1de8ebdf458084bf731e95deba4f074a5008f91b50803aa9a71e3725
turbo-cache-controlno-preview
go-importgithub.com/whythawk/full-stack-fastapi-postgresql git https://github.com/whythawk/full-stack-fastapi-postgresql.git
octolytics-dimension-user_id7559868
octolytics-dimension-user_loginwhythawk
octolytics-dimension-repository_id385291678
octolytics-dimension-repository_nwowhythawk/full-stack-fastapi-postgresql
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id172227885
octolytics-dimension-repository_parent_nwofastapi/full-stack-fastapi-template
octolytics-dimension-repository_network_root_id172227885
octolytics-dimension-repository_network_root_nwofastapi/full-stack-fastapi-template
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef2d67bd549813f8aceb31f205ebdb434e9d46d38
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/issues/44#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fwhythawk%2Ffull-stack-fastapi-postgresql%2Fissues%2F44
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fwhythawk%2Ffull-stack-fastapi-postgresql%2Fissues%2F44
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=whythawk%2Ffull-stack-fastapi-postgresql
Reloadhttps://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/issues/44
Reloadhttps://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/issues/44
Reloadhttps://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/issues/44
whythawk https://patch-diff.githubusercontent.com/whythawk
full-stack-fastapi-postgresqlhttps://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql
fastapi/full-stack-fastapi-templatehttps://patch-diff.githubusercontent.com/fastapi/full-stack-fastapi-template
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fwhythawk%2Ffull-stack-fastapi-postgresql
Fork 49 https://patch-diff.githubusercontent.com/login?return_to=%2Fwhythawk%2Ffull-stack-fastapi-postgresql
Star 256 https://patch-diff.githubusercontent.com/login?return_to=%2Fwhythawk%2Ffull-stack-fastapi-postgresql
Code https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql
Issues 4 https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/issues
Pull requests 0 https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/pulls
Actions https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/actions
Security 0 https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/security
Insights https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/pulse
Code https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql
Issues https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/issues
Pull requests https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/pulls
Actions https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/actions
Security https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/security
Insights https://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/whythawk/full-stack-fastapi-postgresql/issues/44
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/whythawk/full-stack-fastapi-postgresql/issues/44
Pytest issueshttps://patch-diff.githubusercontent.com/whythawk/full-stack-fastapi-postgresql/issues/44#top
https://github.com/jmwebb
https://github.com/jmwebb
jmwebbhttps://github.com/jmwebb
on Dec 12, 2023https://github.com/whythawk/full-stack-fastapi-postgresql/issues/44#issue-2037034248
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.