SlicerDMRI / whitematteranalysis

White matter tractography clustering and more...
https://dmri.slicer.org/whitematteranalysis/
Other
69 stars 34 forks source link

ENH: Relocate contents in `test_run.py` to tests #176

Closed jhlegarreta closed 1 year ago

jhlegarreta commented 1 year ago
jhlegarreta commented 1 year ago

PR #173 should be merged before this one.

Tests will still fail because there is an error unrelated to the tests and having to do with the version of setuptools conflicting, as wma requires 44.0.0 and .github/workflows/test_package.yaml installs a newer version, resulting in:

_________________________ test_help_option[inprocess] __________________________

script_runner = <ScriptRunner inprocess>

    def test_help_option(script_runner):
        ret = script_runner.run(["harden_transform_with_slicer.py", "--help"])
>       assert ret.success
E       assert False
E        +  where False = <pytest_console_scripts.RunResult object at 0x7fbcc922b280>.success

bin/tests/test_harden_transform_with_slicer.py:6: AssertionError
----------------------------- Captured stdout call -----------------------------
# Running console script: ['harden_transform_with_slicer.py', '--help']
# Script return code: 1
# Script stdout:

# Script stderr:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pytest_console_scripts-1.4.1-py3.8.egg/pytest_console_scripts/__init__.py", line 319, in exec_script
    exec(compiled, {'__name__': '__main__'})
  File "/opt/hostedtoolcache/Python/3.8.18/x64/bin/harden_transform_with_slicer.py", line 4, in <module>
    __import__('pkg_resources').run_script('whitematteranalysis==0.3.0', 'harden_transform_with_slicer.py')
  File "/home/runner/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 722, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/runner/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 968, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/runner/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 829, in resolve
    dist = self._resolve_dist(
  File "/home/runner/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 875, in _resolve_dist
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (setuptools 68.2.2 (/home/runner/.local/lib/python3.8/site-packages), Requirement.parse('setuptools==44.0.*'), {'whitematteranalysis'})

raised for exampled in https://github.com/SlicerDMRI/whitematteranalysis/actions/runs/6499992828/job/17654460785?pr=176#step:5:823

This is addressed in https://github.com/SlicerDMRI/whitematteranalysis/pull/157/files#diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552R12

jhlegarreta commented 1 year ago

Further test cases can be imported from PR #74 in a separate PR.