Skip to content

Hello World example can't find mockito during unit tests #685

@arcivanov

Description

@arcivanov
[ERROR] Test has error: unittest.loader._FailedTest.helloworld_tests
Traceback (most recent call last):
  File "/home/arcivanov/.pyenv/versions/3.8.2/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/home/arcivanov/.pyenv/versions/3.8.2/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/home/arcivanov/.pyenv/versions/3.8.2/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/home/arcivanov/.pyenv/versions/3.8.2/lib/python3.8/unittest/loader.py", line 34, in testFailure
    raise self._exception
ImportError: Failed to import test module: helloworld_tests
Traceback (most recent call last):
  File "/home/arcivanov/.pyenv/versions/3.8.2/lib/python3.8/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/home/arcivanov/Documents/src/arcivanov/helloworld/src/unittest/python/helloworld_tests.py", line 1, in <module>
    from mockito import mock, verify
ModuleNotFoundError: No module named 'mockito'


Traceback (most recent call last):
  File "/home/arcivanov/.pyenv/versions/3.8.2/envs/pyb-3.8.2/lib/python3.8/site-packages/pybuilder/cli.py", line 467, in main
    summary = reactor.build(
  File "/home/arcivanov/.pyenv/versions/3.8.2/envs/pyb-3.8.2/lib/python3.8/site-packages/pybuilder/reactor.py", line 235, in build
    execution_summary = self.build_execution_plan(tasks, execution_plan)
  File "/home/arcivanov/.pyenv/versions/3.8.2/envs/pyb-3.8.2/lib/python3.8/site-packages/pybuilder/reactor.py", line 270, in build_execution_plan
    task_execution_summaries = self.execution_manager.execute_execution_plan(
  File "/home/arcivanov/.pyenv/versions/3.8.2/envs/pyb-3.8.2/lib/python3.8/site-packages/pybuilder/execution.py", line 399, in execute_execution_plan
    summaries.append(self.execute_task(task, **kwargs))
  File "/home/arcivanov/.pyenv/versions/3.8.2/envs/pyb-3.8.2/lib/python3.8/site-packages/pybuilder/execution.py", line 346, in execute_task
    task.execute(self.logger, kwargs, _executable=_executable)
  File "/home/arcivanov/.pyenv/versions/3.8.2/envs/pyb-3.8.2/lib/python3.8/site-packages/pybuilder/execution.py", line 187, in execute
    executable.execute(argument_dict)
  File "/home/arcivanov/.pyenv/versions/3.8.2/envs/pyb-3.8.2/lib/python3.8/site-packages/pybuilder/execution.py", line 101, in execute
    self.callable(*arguments)
  File "/home/arcivanov/.pyenv/versions/3.8.2/envs/pyb-3.8.2/lib/python3.8/site-packages/pybuilder/plugins/python/unittest_plugin.py", line 67, in run_unit_tests
    run_tests(project, logger, reactor, "unittest", "unit tests")
  File "/home/arcivanov/.pyenv/versions/3.8.2/envs/pyb-3.8.2/lib/python3.8/site-packages/pybuilder/plugins/python/unittest_plugin.py", line 107, in run_tests
    raise BuildFailedException(msg)
pybuilder.errors.BuildFailedException: There were 1 error(s) and 0 failure(s) in unit tests
------------------------------------------------------------
BUILD FAILED - There were 1 error(s) and 0 failure(s) in unit tests (pybuilder/plugins/python/unittest_plugin.py:107)
------------------------------------------------------------
Build finished at 2020-04-08 16:09:45
Build took 10 seconds (10966 ms)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions