"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 = <test_task.TestCase testMethod=test_assignment_operator>
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_ = <function _gcd_import at 0x7f7591983400>
???
:1027:
name = 'variable_definition', import_ = <function _gcd_import at 0x7f7591983400>
???
E ModuleNotFoundError: No module named 'variable_definition'
:1004: ModuleNotFoundError
During handling of the above exception, another exception occurred:
self = <test_task.TestCase testMethod=test_assignment_operator>
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 = <test_task.TestCase testMethod=test_assignment_operator2>
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_ = <function _gcd_import at 0x7f7591983400>
???
:1027:
name = 'variable_definition', import_ = <function _gcd_import at 0x7f7591983400>
???
E ModuleNotFoundError: No module named 'variable_definition'
:1004: ModuleNotFoundError
During handling of the above exception, another exception occurred:
self = <test_task.TestCase testMethod=test_assignment_operator2>
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 = <test_task.TestCase testMethod=test_chained_assignment>
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_ = <function _gcd_import at 0x7f7591983400>
???
:1027:
name = 'variable_definition', import_ = <function _gcd_import at 0x7f7591983400>
???
E ModuleNotFoundError: No module named 'variable_definition'
:1004: ModuleNotFoundError
During handling of the above exception, another exception occurred:
self = <test_task.TestCase testMethod=test_chained_assignment>
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 = <test_task.TestCase testMethod=test_variable>
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_ = <function _gcd_import at 0x7f7591983400>
???
:1027:
name = 'variable_definition', import_ = <function _gcd_import at 0x7f7591983400>
???
E ModuleNotFoundError: No module named 'variable_definition'
:1004: ModuleNotFoundError
During handling of the above exception, another exception occurred:
self = <test_task.TestCase testMethod=test_variable>
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