fireant-bot / fireant

Fireant is a Dependabot-like service (tailored to Apache Ant + Ivy projects) which creates pull requests to keep your dependencies secure and up-to-date.
https://github.com/fireant-bot/fireant
Apache License 2.0
1 stars 1 forks source link

ISSUE-38 Create unit tests for checking that xml comments are preserved #43

Closed ufUNnxagpM closed 3 years ago

ufUNnxagpM commented 3 years ago

https://github.com/fireant-bot/fireant/issues/38

@lewismc

The test fails when ran on the code in main, but it should pass when the code preserves comments.

Off-topic, but I had to temporarily move test_dependencyfile.py into the parent folder for it to run. I think there's an issue with how the imports are working when tests are placed in the tests/ directory (see pytest output below). Should probably open another issue for this though.

machu@Altair ~/git/other/fireant ±ISSUE-38⚡ » pytest                                                                                                  2 ↵
=================================================================== test session starts ===================================================================
platform linux -- Python 3.9.4, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/machu/git/other/fireant
collected 0 items / 1 error                                                                                                                               

========================================================================= ERRORS ==========================================================================
______________________________________________________ ERROR collecting tests/test_dependencyfile.py ______________________________________________________
ImportError while importing test module '/home/machu/git/other/fireant/tests/test_dependencyfile.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_dependencyfile.py:22: in <module>
    from ..dependencyfile import DependencyFile
E   ImportError: attempted relative import with no known parent package
================================================================= short test summary info =================================================================
ERROR tests/test_dependencyfile.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==================================================================== 1 error in 0.06s =====================================================================