mozilla / mozilla/probe-scraper

Error when running tests in local environment

Open
#210 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
26
Forks
73
Avg merge
10h
Merged PRs (30d)
3

Description

pip install -r requirements.txt
pip install -r test_requirements.txt
python setup.py develop

After running above commands when I am running tests locally I am getting error

Command: pytest tests/
Error:

======================================================================= ERRORS =======================================================================
_________________________________________________ ERROR collecting tests/test_probe_expiry_alert.py __________________________________________________
ImportError while importing test module '/home/jhabar/mozilla/probe-scraper/tests/test_probe_expiry_alert.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.6/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_probe_expiry_alert.py:2: in <module>
    from dataclasses import dataclass
E   ModuleNotFoundError: No module named 'dataclasses'
============================================================== short test summary info ===============================================================
ERROR tests/test_probe_expiry_alert.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Dependencies

Python: 3.6.9
Distributor ID: Peppermint
Description: Peppermint 10 Ten
Release: 10
Codename: bionic

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the setup with Python 3.6.9 using requirements.txt, test_requirements.txt, and setup.py develop, then run pytest tests/. Read tests/test_probe_expiry_alert.py, especially its dataclasses import, and inspect the dependency files to determine how the test suite should support the documented environment. Done means pytest tests/ completes collection without the reported ModuleNotFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.