Maven tests fail as MavenRequirement is not a context manager
The tests were not being run (see #39 (closed)) , so the tests were skipped in !14 (merged) , and these failures were not noticed. PackageRequirement
is not a context manager, so __enter__
does not exist and with
can not be used.
_________________________________________________________ MavenRequirementTestCase.test_installed_requirement _________________________________________________________
self = <tests.MavenRequirementTest.MavenRequirementTestCase testMethod=test_installed_requirement>
def test_installed_requirement(self):
> with MavenRequirement('com.puppycrawl.tools:checkstyle', '6.15'):
E AttributeError: __enter__
tests/MavenRequirementTest.py:11: AttributeError
______________________________________________________________ MavenRequirementTestCase.test_no_version _______________________________________________________________
self = <tests.MavenRequirementTest.MavenRequirementTestCase testMethod=test_no_version>
def test_no_version(self):
logger = logging.getLogger()
with self.assertLogs(logger, 'ERROR') as log:
> with MavenRequirement('com.puppycrawl.tools:checkstyle'):
E TypeError: __init__() missing 1 required positional argument: 'version'
tests/MavenRequirementTest.py:42: TypeError
_______________________________________________________ MavenRequirementTestCase.test_not_installed_requirement _______________________________________________________
self = <tests.MavenRequirementTest.MavenRequirementTestCase testMethod=test_not_installed_requirement>
def test_not_installed_requirement(self):
> with MavenRequirement('com.puppycrawl.tools:checkstyle', '6.15'):
E AttributeError: __enter__
tests/MavenRequirementTest.py:24: AttributeError
_________________________________________________________ MavenRequirementTestCase.test_wrong_package_format __________________________________________________________
self = <tests.MavenRequirementTest.MavenRequirementTestCase testMethod=test_wrong_package_format>
def test_wrong_package_format(self):
logger = logging.getLogger()
with self.assertLogs(logger, 'ERROR') as log:
> with MavenRequirement('com.puppycrawl.tools.checkstyle', '6.15'):
E AttributeError: __enter__
tests/MavenRequirementTest.py:32: AttributeError