Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken tests #45

Closed
nicholasamorim opened this issue May 1, 2019 · 1 comment · Fixed by #46
Closed

Broken tests #45

nicholasamorim opened this issue May 1, 2019 · 1 comment · Fixed by #46

Comments

@nicholasamorim
Copy link

nicholasamorim commented May 1, 2019

Running the tests on both Py27 and 37 yielded 4 errors on the mocking of library.degoss.open.

I know they are passing in the official build but they failed on both 2.7 and 3.7 for me. Changing the patching to use mock_open made it pass on both versions.

.............E..EEE....
======================================================================
ERROR: test_install (__main__.DegossTestCase)
Tests that degoss can install Goss successfully.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1193, in patched
    arg = patching.__enter__()
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1268, in __enter__
    original, local = self.get_original()
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1242, in get_original
    "%s does not have the attribute %r" % (target, name)
AttributeError: <module 'library.degoss' from '/Users/nicholas/src/ansible-role-degoss/library/degoss.py'> does not have the attribute 'open'

======================================================================
ERROR: test_run_tests_error (__main__.DegossTestCase)
Tests that degoss can handle error cases when running tests.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1193, in patched
    arg = patching.__enter__()
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1268, in __enter__
    original, local = self.get_original()
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1242, in get_original
    "%s does not have the attribute %r" % (target, name)
AttributeError: <module 'library.degoss' from '/Users/nicholas/src/ansible-role-degoss/library/degoss.py'> does not have the attribute 'open'

======================================================================
ERROR: test_run_tests_failure (__main__.DegossTestCase)
Tests that degoss can handle failed tests appropriately.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1193, in patched
    arg = patching.__enter__()
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1268, in __enter__
    original, local = self.get_original()
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1242, in get_original
    "%s does not have the attribute %r" % (target, name)
AttributeError: <module 'library.degoss' from '/Users/nicholas/src/ansible-role-degoss/library/degoss.py'> does not have the attribute 'open'

======================================================================
ERROR: test_run_tests_success (__main__.DegossTestCase)
Tests that degoss can handle successful tests appropriately.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1193, in patched
    arg = patching.__enter__()
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1268, in __enter__
    original, local = self.get_original()
  File "/Users/nicholas/.virtualenvs/otcas27/lib/python2.7/site-packages/mock.py", line 1242, in get_original
    "%s does not have the attribute %r" % (target, name)
AttributeError: <module 'library.degoss' from '/Users/nicholas/src/ansible-role-degoss/library/degoss.py'> does not have the attribute 'open'

----------------------------------------------------------------------
Ran 23 tests in 0.036s

FAILED (errors=4)
@naftulikay
Copy link
Owner

Do you have more context on why it's failing? Looking at the last build log, I don't see any failures. Tests there appear to be passing on Python 3.6. Looking at the PR next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants