Skip to content

[Error Handling]: ImportError while importing test module (Error-Handling Messaging & Exercises) #2275

Open
@dan9731

Description

@dan9731

Good day. I first offer the obligatory "I'm not GitHub-savvy" apology. I did look for an answer as prescribed here, following steps in subheading Opening an Issue. But I have not seen anything. I've seen some fixes on Stack Overflow. But they make no sense to me. Please don't crush me if I'm doing this wrong.

I'm working on a new linux install. On my previous installation, I ran pytest successfully many times (28 to be precise). With this new installation, I've run it once successfully on exercise Twelve Days of Christmas. It's giving me this error now:

$ /home/dan/.local/bin/pytest meetup_test.py 
============================= test session starts ==============================
platform linux -- Python 3.8.5, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
rootdir: /home/dan/exercism/python/meetup
collected 0 items / 1 error                                                    

==================================== ERRORS ====================================
_______________________ ERROR collecting meetup_test.py ________________________
ImportError while importing test module '/home/dan/exercism/python/meetup/meetup_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
meetup_test.py:4: in <module>
    from meetup import meetup, MeetupDayException
E   ImportError: cannot import name 'MeetupDayException' from 'meetup' (/home/dan/exercism/python/meetup/meetup.py)
=========================== short test summary info ============================
ERROR meetup_test.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.09s ===============================
$

I tried removing the meetup directory and re-downloading from the CLI. I get this error no matter what the contents of meetup.py are. So, I'm guessing that I have some issue either with they way pytest is configured or with my meetup_pytest file.

Any assistance greatly appreciated.

Thank you so much.
Dan.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions