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

ModuleNotFoundError when running pytest #1

Open
grggls opened this issue Dec 19, 2022 · 1 comment
Open

ModuleNotFoundError when running pytest #1

grggls opened this issue Dec 19, 2022 · 1 comment

Comments

@grggls
Copy link

grggls commented Dec 19, 2022

Issue Overview

When running pytest from anywhere in the project, "ModuleNotFound" errors are thrown for each of the local packages.

Describe your environment

I'm using codespaces

Steps to Reproduce

  1. Start codespaces in this repository
  2. Install pytest in the running container
  3. Run pytest from anywhere in the project
  4. Note the errors for each package we're trying to import in each of the test_ files in the test directory:
ERROR tests/test_age_slowest_race.py
ERROR tests/test_arg_checker.py
ERROR tests/test_calculator.py
ERROR tests/test_html2markdown.py
ERROR tests/test_linkedin_checker.py
ERROR tests/test_medals.py
ERROR tests/test_pairwise_offset.py

Expected Behavior

The modules are imported and pytest runs

Current Behavior

The modules are not loaded and the tests never get to run.

Related Issues

N/A

@tim-hub
Copy link

tim-hub commented Mar 22, 2023

this author seems busy, he mentioned here https://github.com/LinkedInLearning/level-up-advanced-python-3213390/blob/main/CONTRIBUTING.md

He could not take any issues or PRs.

For all the import in test files, you need to make some changes like this

from average_race_time import get_data, get_average, get_rhines_times
from challenge.average_race_time import get_data, get_average, get_rhines_times

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

No branches or pull requests

2 participants