No module name error- despite checking the file structure

Viewed 19
=================================== ERRORS ====================================
_______________________ ERROR collecting test_roman.py ________________________
ImportError while importing test module 'C:\Users\HansPeterJonasHogh-J\dev\repos\roman_numeral\tests\test_roman.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
..\..\..\..\.pyenv\pyenv-win\versions\3.9.6\lib\importlib\__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test_roman.py:3: in <module>
    from to_roman_numeral_converter import to_roman_numeral
E   ModuleNotFoundError: No module named 'to_roman_numeral_converter'
=========================== short test summary info ===========================
ERROR test_roman.py
!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
============================== 1 error in 0.16s ===============================

I have the above error- however, I my file structure and spelling is correct? SO not sure why it cannot locate the file to_roman_numeral_converter : below is the test file.

import unittest

from to_roman_numeral_converter import to_roman_numeral

def test_to_roman_numeral_1_atn():
    """simple to_roman_numeral (1) == I"""
    assert to_roman_numeral(1) == "I"

if __name__ == "__main__":
    unittest.main()

I have a test folder in my main directory- and outside that folder in the main is my to_roman_numeral file...

Any help here would help this student greatly.

0 Answers
Related