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

test_dataverse.py produces warning/error messages. #42

Open
markrlondon opened this issue Jun 6, 2017 · 2 comments
Open

test_dataverse.py produces warning/error messages. #42

markrlondon opened this issue Jun 6, 2017 · 2 comments

Comments

@markrlondon
Copy link

Can you upgrade test_dataverse.py so that it doesn't produce the following error? Thanks.

t# py.test test_dataverse.py::TestConnection::test_connect
============================= test session starts ==============================
platform linux2 -- Python 2.7.6 -- pytest-2.5.1
collected 8 items

test_dataverse.py .E

==================================== ERRORS ====================================
_______________ ERROR at teardown of TestConnection.test_connect _______________

cls = <class 'dataverse.test.test_dataverse.TestConnection'>

@classmethod
def teardown_class(cls):
    """Delete the temporary user.

        Note that this will fail if the user has any non-deleted content.
        """
    delete_url = 'https://{0}/api/admin/authenticatedUsers/{1}/'.format(
        TEST_HOST, cls.username,
    )
    resp = requests.delete(delete_url)
  assert resp.status_code == 200

E assert 503 == 200
E + where 503 = <Response [503]>.status_code

test_dataverse.py:55: AssertionError
------------------------------- Captured stderr --------------------------------
/usr/local/lib/python2.7/dist-packages/src/dataverselj/dataverse/test/test_dataverse.py:113: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
assert connection._service_document
====================== 1 passed, 1 error in 1.16 seconds =======================
root@report:/usr/local/lib/python2.7/dist-packages/src/dataverselj/dataverse/test#

@pdurbin
Copy link
Member

pdurbin commented Jun 7, 2017

@markrlondon thanks for the bug report! Does this seem to be the same issue as #32?

@markrlondon
Copy link
Author

This is a different problem. There has been a warning in XML parsing code that a behavior is someday going to change, and that you have to update your code. See the following link. Strangely, according to that page, the warning has been there for 7+ years, and it's never actually been implemented.

https://stackoverflow.com/questions/18583162/difference-between-if-obj-and-if-obj-is-not-none

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

No branches or pull requests

2 participants