Skip to content

Some unit tests depend on actually running mvn #702

Description

@ivanovmg

These unit tests depend on mvn and actually run it, which makes them not-so-unit-tests.

These tests require mvn executable:

  • test/metrics/npath/test_all_types.py::JavaTestCase::testHighScore
  • test/metrics/npath/test_all_types.py::JavaTestCase::testIncorrectFormat
  • test/metrics/npath/test_all_types.py::JavaTestCase::testLowScore
  • test/metrics/npath/test_all_types.py::JavaTestCase::testMediumScore

One may consider using mocking out subprocess for these tests.

There is pytest-subprocess plugin, which allows one to do it quite smoothly.
https://pypi.org/project/pytest-subprocess/
This will require switching to pytest, though.

Related PR: #701

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions