LinkedInLearning / level-up-advanced-python-3213390

This is a LinkedIn Learning repo for Level Up: Advanced Core Python.
Other
22 stars 260 forks source link

ModuleNotFoundError when running pytest #1

Open grggls opened 1 year ago

grggls commented 1 year ago

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 commented 1 year ago

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