jetbrains-academy / introduction_to_python

Introduction to Python course
MIT License
42 stars 27 forks source link

Variables / Variable Definition #144

Closed edutools-service closed 1 year ago

edutools-service commented 1 year ago

"Check" button always shows incorect after checking /usr/bin/python3.10 /home/sridip/pycharm-community-2022.3/plugins/python-ce/helpers/pycharm/_jb_pytest_runner.py --path /home/sridip/PycharmProjects/Introduction to Python/Variables/Variable definition/tests/test_task.py Testing started at 10:19 pm ... Launching pytest with arguments /home/sridip/PycharmProjects/Introduction to Python/Variables/Variable definition/tests/test_task.py --no-header --no-summary -q in /home/sridip/PycharmProjects/Introduction to Python/Variables/Variable definition

============================= test session starts ============================== collecting ... collected 4 items

tests/test_task.py::TestCase::test_assignment_operator FAILED [ 25%] tests/test_task.py:28 (TestCase.test_assignment_operator) self =

def setUp(self):
    try:
        # Stores output from print() in actualOutput
        with patch('sys.stdout', new=StringIO()) as self.actualOutput:
            # Loads submission on first test, reloads on subsequent tests
            if self.task_name in sys.modules:
                importlib.reload(sys.modules[self.task_name])
            else:
              importlib.import_module(self.task_name)

tests/test_task.py:24:


name = 'variable_definition', package = None

def import_module(name, package=None):
    """Import a module.

    The 'package' argument is required when performing a relative import. It
    specifies the package to use as the anchor point from which to resolve the
    relative import to an absolute import.

    """
    level = 0
    if name.startswith('.'):
        if not package:
            msg = ("the 'package' argument is required to perform a relative "
                   "import for {!r}")
            raise TypeError(msg.format(name))
        for character in name:
            if character != '.':
                break
            level += 1
  return _bootstrap._gcd_import(name[level:], package, level)

/usr/lib/python3.10/importlib/init.py:126:


name = 'variable_definition', package = None, level = 0

???

:1050: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', import_ = > ??? :1027: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', import_ = > ??? E ModuleNotFoundError: No module named 'variable_definition' :1004: ModuleNotFoundError During handling of the above exception, another exception occurred: self = def setUp(self): try: # Stores output from print() in actualOutput with patch('sys.stdout', new=StringIO()) as self.actualOutput: # Loads submission on first test, reloads on subsequent tests if self.task_name in sys.modules: importlib.reload(sys.modules[self.task_name]) else: importlib.import_module(self.task_name) except Exception as e: > self.fail("There was a problem while loading the solution – {0}. Check the solution for IDE-highlighted " "errors and warnings.".format(str(e))) E AssertionError: There was a problem while loading the solution – No module named 'variable_definition'. Check the solution for IDE-highlighted errors and warnings. tests/test_task.py:26: AssertionError FAILED [ 50%] tests/test_task.py:37 (TestCase.test_assignment_operator2) self = def setUp(self): try: # Stores output from print() in actualOutput with patch('sys.stdout', new=StringIO()) as self.actualOutput: # Loads submission on first test, reloads on subsequent tests if self.task_name in sys.modules: importlib.reload(sys.modules[self.task_name]) else: > importlib.import_module(self.task_name) tests/test_task.py:24: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', package = None def import_module(name, package=None): """Import a module. The 'package' argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import. """ level = 0 if name.startswith('.'): if not package: msg = ("the 'package' argument is required to perform a relative " "import for {!r}") raise TypeError(msg.format(name)) for character in name: if character != '.': break level += 1 > return _bootstrap._gcd_import(name[level:], package, level) /usr/lib/python3.10/importlib/__init__.py:126: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', package = None, level = 0 > ??? :1050: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', import_ = > ??? :1027: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', import_ = > ??? E ModuleNotFoundError: No module named 'variable_definition' :1004: ModuleNotFoundError During handling of the above exception, another exception occurred: self = def setUp(self): try: # Stores output from print() in actualOutput with patch('sys.stdout', new=StringIO()) as self.actualOutput: # Loads submission on first test, reloads on subsequent tests if self.task_name in sys.modules: importlib.reload(sys.modules[self.task_name]) else: importlib.import_module(self.task_name) except Exception as e: > self.fail("There was a problem while loading the solution – {0}. Check the solution for IDE-highlighted " "errors and warnings.".format(str(e))) E AssertionError: There was a problem while loading the solution – No module named 'variable_definition'. Check the solution for IDE-highlighted errors and warnings. tests/test_task.py:26: AssertionError FAILED [ 75%] tests/test_task.py:58 (TestCase.test_chained_assignment) self = def setUp(self): try: # Stores output from print() in actualOutput with patch('sys.stdout', new=StringIO()) as self.actualOutput: # Loads submission on first test, reloads on subsequent tests if self.task_name in sys.modules: importlib.reload(sys.modules[self.task_name]) else: > importlib.import_module(self.task_name) tests/test_task.py:24: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', package = None def import_module(name, package=None): """Import a module. The 'package' argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import. """ level = 0 if name.startswith('.'): if not package: msg = ("the 'package' argument is required to perform a relative " "import for {!r}") raise TypeError(msg.format(name)) for character in name: if character != '.': break level += 1 > return _bootstrap._gcd_import(name[level:], package, level) /usr/lib/python3.10/importlib/__init__.py:126: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', package = None, level = 0 > ??? :1050: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', import_ = > ??? :1027: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', import_ = > ??? E ModuleNotFoundError: No module named 'variable_definition' :1004: ModuleNotFoundError During handling of the above exception, another exception occurred: self = def setUp(self): try: # Stores output from print() in actualOutput with patch('sys.stdout', new=StringIO()) as self.actualOutput: # Loads submission on first test, reloads on subsequent tests if self.task_name in sys.modules: importlib.reload(sys.modules[self.task_name]) else: importlib.import_module(self.task_name) except Exception as e: > self.fail("There was a problem while loading the solution – {0}. Check the solution for IDE-highlighted " "errors and warnings.".format(str(e))) E AssertionError: There was a problem while loading the solution – No module named 'variable_definition'. Check the solution for IDE-highlighted errors and warnings. tests/test_task.py:26: AssertionError FAILED [100%] tests/test_task.py:46 (TestCase.test_variable) self = def setUp(self): try: # Stores output from print() in actualOutput with patch('sys.stdout', new=StringIO()) as self.actualOutput: # Loads submission on first test, reloads on subsequent tests if self.task_name in sys.modules: importlib.reload(sys.modules[self.task_name]) else: > importlib.import_module(self.task_name) tests/test_task.py:24: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', package = None def import_module(name, package=None): """Import a module. The 'package' argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import. """ level = 0 if name.startswith('.'): if not package: msg = ("the 'package' argument is required to perform a relative " "import for {!r}") raise TypeError(msg.format(name)) for character in name: if character != '.': break level += 1 > return _bootstrap._gcd_import(name[level:], package, level) /usr/lib/python3.10/importlib/__init__.py:126: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', package = None, level = 0 > ??? :1050: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', import_ = > ??? :1027: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'variable_definition', import_ = > ??? E ModuleNotFoundError: No module named 'variable_definition' :1004: ModuleNotFoundError During handling of the above exception, another exception occurred: self = def setUp(self): try: # Stores output from print() in actualOutput with patch('sys.stdout', new=StringIO()) as self.actualOutput: # Loads submission on first test, reloads on subsequent tests if self.task_name in sys.modules: importlib.reload(sys.modules[self.task_name]) else: importlib.import_module(self.task_name) except Exception as e: > self.fail("There was a problem while loading the solution – {0}. Check the solution for IDE-highlighted " "errors and warnings.".format(str(e))) E AssertionError: There was a problem while loading the solution – No module named 'variable_definition'. Check the solution for IDE-highlighted errors and warnings. tests/test_task.py:26: AssertionError tests/test_task.py::TestCase::test_assignment_operator2 tests/test_task.py::TestCase::test_chained_assignment tests/test_task.py::TestCase::test_variable ============================== 4 failed in 0.14s =============================== Process finished with exit code 1
sofiiako commented 1 year ago

Hi! Could you please try checking if you have a correct Python interpreter in the project settings? If not, please configure it: PyCharm; IDEA. Try reloading the project and checking tasks again. If you continue experiencing the issue, please send us full logs from Help->Show Log in Explorer/Finder. Please also include the IDE version, EduTools plugin version, and OS. Thank you!