Unit tests failing under Python 3

Bug #1729283 reported by Thomas Goirand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash8
New
Undecided
Unassigned

Bug Description

Building the package for version 0.5.1 has Python 3.6 unit test failure as per below.

======================================================================
FAIL: bashate.tests.test_bashate.TestBashate.test_main_no_files
bashate.tests.test_bashate.TestBashate.test_main_no_files
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''
  stderr
  stdout

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/<<PKGBUILDDIR>>/bashate/tests/test_bashate.py", line 43, in test_main_no_files
    result = bashate.main()
  File "/<<PKGBUILDDIR>>/bashate/bashate.py", line 377, in main
    description='A bash script style checker')
  File "/usr/lib/python3.6/argparse.py", line 1631, in __init__
    prog = _os.path.basename(_sys.argv[0])
  File "/usr/lib/python3.6/posixpath.py", line 144, in basename
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not MagicMock

======================================================================
FAIL: bashate.tests.test_bashate.TestBashate.test_main_return_one_on_errors
bashate.tests.test_bashate.TestBashate.test_main_return_one_on_errors
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''
  stderr
  stdout

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/<<PKGBUILDDIR>>/bashate/tests/test_bashate.py", line 55, in test_main_return_one_on_errors
    result = bashate.main()
  File "/<<PKGBUILDDIR>>/bashate/bashate.py", line 377, in main
    description='A bash script style checker')
  File "/usr/lib/python3.6/argparse.py", line 1631, in __init__
    prog = _os.path.basename(_sys.argv[0])
  File "/usr/lib/python3.6/posixpath.py", line 144, in basename
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not MagicMock

======================================================================
FAIL: bashate.tests.test_bashate.TestBashate.test_main_return_one_on_ioerror
bashate.tests.test_bashate.TestBashate.test_main_return_one_on_ioerror
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''
  stderr
  stdout

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/<<PKGBUILDDIR>>/bashate/tests/test_bashate.py", line 67, in test_main_return_one_on_ioerror
    result = bashate.main()
  File "/<<PKGBUILDDIR>>/bashate/bashate.py", line 377, in main
    description='A bash script style checker')
  File "/usr/lib/python3.6/argparse.py", line 1631, in __init__
    prog = _os.path.basename(_sys.argv[0])
  File "/usr/lib/python3.6/posixpath.py", line 144, in basename
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not MagicMock

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.