ggonnella / fastsubtrees

Python library and command line script , for fast extraction of subtrees of fairly large trees, consisting of millions of nodes, such as the NCBI taxonomy tree.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tests from the repository root

ggonnella opened this issue · comments

@vinisalazar wrote:

Tests with pytest should ideally be run from the repository root instead of the tests/ directory (related to #4).

This actually works correctly on systems I can access (and it worked also in previous versions), i.e. writing "pytest" in the main repository directory runs the tests of fastsubtrees and those of ntmirror (by default skipping the database-dependant tests of the latter).

@ggonnella this is the traceback that I get when running the tests from the repository root.

======================= test session starts ========================
platform darwin -- Python 3.10.6, pytest-7.1.3, pluggy-1.0.0
rootdir: /Users/vwsalazar/Bio/joss/fastsubtrees
plugins: cov-4.0.0, console-scripts-1.3.1
collected 62 items                                                 

ntdownload/tests/test_downloader_api.py FFFFFF               [  9%]
ntdownload/tests/test_downloader_cli.py FFFFFF               [ 19%]
ntdownload/tests/test_names_api.py .                         [ 20%]
ntdownload/tests/test_names_cli.py .                         [ 22%]
ntmirror/tests/test_dbload_api.py ss                         [ 25%]
ntmirror/tests/test_dbload_cli.py ss                         [ 29%]
tests/test_cli.py ............                                                                               [ 48%]
tests/test_construction.py .............                                                                     [ 69%]
tests/test_edit_tree.py .............                                                                        [ 90%]
tests/test_file_io.py ...                                                                                    [ 95%]
tests/test_query.py ...                                                                                      [100%]

===================================================== FAILURES =====================================================
_______________________________________________ test_first_download ________________________________________________

testout = <function testout.<locals>.<lambda> at 0x10b1eb6d0>

    def test_first_download(testout):
      outdir=testout("first_download")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_api.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/first_download -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/first_download: No such file or direc
tory                                                                                                                E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
______________________________________________ test_no_newer_version _______________________________________________

testout = <function testout.<locals>.<lambda> at 0x10bcc6290>

    def test_no_newer_version(testout):
      outdir=testout("no_newer_version")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_api.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/no_newer_version -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/no_newer_version: No such file or dir
ectory                                                                                                              E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
________________________________________________ test_newer_version ________________________________________________

testout = <function testout.<locals>.<lambda> at 0x10be53370>

    def test_newer_version(testout):
      outdir=testout("newer_version")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_api.py:52: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/newer_version -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/newer_version: No such file or direct
ory                                                                                                                 E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
__________________________________________________ test_no_unpack __________________________________________________

testout = <function testout.<locals>.<lambda> at 0x10be53760>

    def test_no_unpack(testout):
      outdir=testout("no_unpack")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_api.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/no_unpack -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/no_unpack: No such file or directory
E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
_________________________________________________ test_force_https _________________________________________________

testout = <function testout.<locals>.<lambda> at 0x10bcc68c0>

    def test_force_https(testout):
      outdir=testout("force_https")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_api.py:80: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/force_https -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/force_https: No such file or director
y                                                                                                                   E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
_______________________________________________ test_fallback_https ________________________________________________

testout = <function testout.<locals>.<lambda> at 0x10bec3d90>

    def test_fallback_https(testout):
      outdir=testout("fallback_https")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_api.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/fallback_https -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/fallback_https: No such file or direc
tory                                                                                                                E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
_________________________________________ test_first_download[subprocess] __________________________________________

testout = <function testout.<locals>.<lambda> at 0x10bec05e0>
script = <function script.<locals>.<lambda> at 0x10bec1750>, script_runner = <ScriptRunner subprocess>

    @pytest.mark.script_launch_mode('subprocess')
    def test_first_download(testout, script, script_runner):
      outdir=testout("first_download")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_cli.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/first_download -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/first_download: No such file or direc
tory                                                                                                                E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
________________________________________ test_no_newer_version[subprocess] _________________________________________

testout = <function testout.<locals>.<lambda> at 0x10bec27a0>
script = <function script.<locals>.<lambda> at 0x10bec1510>, script_runner = <ScriptRunner subprocess>

    @pytest.mark.script_launch_mode('subprocess')
    def test_no_newer_version(testout, script, script_runner):
      outdir=testout("no_newer_version")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_cli.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/no_newer_version -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/no_newer_version: No such file or dir
ectory                                                                                                              E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
__________________________________________ test_newer_version[subprocess] __________________________________________

testout = <function testout.<locals>.<lambda> at 0x10bec13f0>
script = <function script.<locals>.<lambda> at 0x10bec20e0>, script_runner = <ScriptRunner subprocess>

    @pytest.mark.script_launch_mode('subprocess')
    def test_newer_version(testout, script, script_runner):
      outdir=testout("newer_version")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_cli.py:55: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/newer_version -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/newer_version: No such file or direct
ory                                                                                                                 E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
____________________________________________ test_no_unpack[subprocess] ____________________________________________

testout = <function testout.<locals>.<lambda> at 0x10bcc6710>
script = <function script.<locals>.<lambda> at 0x10bcc6830>, script_runner = <ScriptRunner subprocess>

    @pytest.mark.script_launch_mode('subprocess')
    def test_no_unpack(testout, script, script_runner):
      outdir=testout("no_upack")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_cli.py:72: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/no_upack -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/no_upack: No such file or directory
E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
___________________________________________ test_force_https[subprocess] ___________________________________________

testout = <function testout.<locals>.<lambda> at 0x10bcc64d0>
script = <function script.<locals>.<lambda> at 0x10bcc65f0>, script_runner = <ScriptRunner subprocess>

    @pytest.mark.script_launch_mode('subprocess')
    def test_force_https(testout, script, script_runner):
      outdir=testout("no_upack")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_cli.py:84: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/no_upack -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/no_upack: No such file or directory
E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
___________________________________________ test_exception2[subprocess] ____________________________________________

testout = <function testout.<locals>.<lambda> at 0x10bec0550>
script = <function script.<locals>.<lambda> at 0x10bec3400>, script_runner = <ScriptRunner subprocess>

    @pytest.mark.script_launch_mode('subprocess')
    def test_exception2(testout, script, script_runner):
      outdir=testout("exception2")
>     sh.rm(outdir, "-rf")

ntdownload/tests/test_downloader_cli.py:96: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:1524: in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:788: in __init__
    self.wait()
../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:845: in wait
    self.handle_command_exit_code(exit_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , code = 1

    def handle_command_exit_code(self, code):
        """ here we determine if we had an exception, or an error code that we
        weren't expecting to see.  if we did, we create and raise an exception
        """
        ca = self.call_args
        exc_class = get_exc_exit_code_would_raise(code, ca["ok_code"], ca["piped"])
        if exc_class:
            exc = exc_class(self.ran, self.process.stdout, self.process.stderr, ca["truncate_exc"])
>           raise exc
E           sh.ErrorReturnCode_1: 
E           
E             RAN: /bin/rm /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/exception2 -rf
E           
E             STDOUT:
E           
E           
E             STDERR:
E           rm: /Users/vwsalazar/Bio/joss/fastsubtrees/ntdownload/tests/output/exception2: No such file or directory
E           rm: -rf: No such file or directory

../../../miniconda3/envs/fastsubtrees/lib/python3.10/site-packages/sh.py:869: ErrorReturnCode_1
============================================= short test summary info ==============================================
FAILED ntdownload/tests/test_downloader_api.py::test_first_download - sh.ErrorReturnCode_1: 
FAILED ntdownload/tests/test_downloader_api.py::test_no_newer_version - sh.ErrorReturnCode_1: 
FAILED ntdownload/tests/test_downloader_api.py::test_newer_version - sh.ErrorReturnCode_1: 
FAILED ntdownload/tests/test_downloader_api.py::test_no_unpack - sh.ErrorReturnCode_1: 
FAILED ntdownload/tests/test_downloader_api.py::test_force_https - sh.ErrorReturnCode_1: 
FAILED ntdownload/tests/test_downloader_api.py::test_fallback_https - sh.ErrorReturnCode_1: 
FAILED ntdownload/tests/test_downloader_cli.py::test_first_download[subprocess] - sh.ErrorReturnCode_1: 
FAILED ntdownload/tests/test_downloader_cli.py::test_no_newer_version[subprocess] - sh.ErrorReturnCode_1: 
FAILED ntdownload/tests/test_downloader_cli.py::test_newer_version[subprocess] - sh.ErrorReturnCode_1: 
FAILED ntdownload/tests/test_downloader_cli.py::test_no_unpack[subprocess] - sh.ErrorReturnCode_1: 
FAILED ntdownload/tests/test_downloader_cli.py::test_force_https[subprocess] - sh.ErrorReturnCode_1: 
FAILED ntdownload/tests/test_downloader_cli.py::test_exception2[subprocess] - sh.ErrorReturnCode_1: 
==================================== 12 failed, 46 passed, 4 skipped in 12.42s =====================================

OK it looks like a a MacOS problem. The standard tools on MacOS need the option before the other arguments. I'll turn the order.