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

Unit tests fail on Windows #24

Closed
synapticarbors opened this issue Dec 19, 2016 · 1 comment
Closed

Unit tests fail on Windows #24

synapticarbors opened this issue Dec 19, 2016 · 1 comment

Comments

@synapticarbors
Copy link
Contributor

In preparing a conda recipe on conda-forge, I observed several tests failing on windows when appveyor tried to run the tests:

======================================================================
FAIL: test_get_app_key (tests.test_baseclient.BaseClientTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\users\josh\documents\github\betfairlightweight\tests\test_baseclient.py", line 94, in tes
t_get_app_key
    self.client.get_app_key()
AssertionError: AppKeyError not raised

======================================================================
FAIL: test_strip_datetime (tests.test_baseresource.BaseResourceInit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\users\josh\documents\github\betfairlightweight\tests\test_baseresource.py", line 87, in t
est_strip_datetime
    assert type(stripped) == datetime.datetime
AssertionError

======================================================================
FAIL: test_strip_datetime_resource (tests.test_baseresource.BaseResourceInit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\users\josh\documents\github\betfairlightweight\tests\test_baseresource.py", line 116, in
test_strip_datetime_resource
    assert model_response.datetime_int == datetime.datetime.utcfromtimestamp(1465631675000 / 1e3)
AssertionError

----------------------------------------------------------------------
Ran 203 tests in 0.844s

FAILED (failures=3)

test_get_app_key:

This test fails because os.environ.get(self.username), where self.username=="username" returns a non-None response since USERNAME is a standard windows environment variable (note that Windows env variables are case insensitive).

test_strip_datetime:

Fails on py27 since integer is a long rather than an int. There is an easy fix for this.

test_strip_datetime_resource

There is a platform dependent exception that is raised so only catching ValueError is insufficient.

@liampauling
Copy link
Member

Thanks Joshua, I took your two commits and changed the version before merging (makes life easier when updating pypi)

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